from fmatch.saas.operators.fix_phone_format import fix_phone_format
from fmatch.saas.operators.normalize_phone_to_e164 import normalize_phone_to_e164


def test_us_phone_basic():
    assert fix_phone_format("(415) 555-1212", country="US")["value"] == "+14155551212"
    assert fix_phone_format("(415) 555-1212 x123", country="US")["value"] == "+14155551212"
    assert fix_phone_format("123", country="US")["value"] == ""
    assert (
        fix_phone_format("(415) 555-1212", country="US")["value"]
        == normalize_phone_to_e164("(415) 555-1212", country="US")["value"]
    )

