import logging

import pytest

from fmatch.saas.operators.normalize_title import normalize_title


def test_title_rules():
    v = normalize_title("VP, Biz Dev (NA)")["value"]
    assert v["seniority"] in {"VP", "CXO", "Director", "Manager", "Owner", "IC"}
    assert isinstance(v["department"], str)


def test_no_info_log_when_llm_disabled(monkeypatch: pytest.MonkeyPatch, caplog: pytest.LogCaptureFixture):
    monkeypatch.setenv("TRANSFORM_ENABLE_LLM_FALLBACK", "false")
    caplog.set_level(logging.INFO, logger="fmatch.saas.operators.normalize_title")

    normalize_title("VP Sales")

    assert not caplog.records

