from src.services.notification_matrix import resolve_chat_ids


def test_all_alert_types_resolve_to_sre_group_first() -> None:
    for notification_type in [
        "TYPE-1",
        "TYPE-2",
        "TYPE-3",
        "TYPE-4",
        "TYPE-4D",
        "TYPE-5S",
        "TYPE-6B",
        "TYPE-7E",
        "TYPE-8M",
        "UNKNOWN",
    ]:
        assert resolve_chat_ids(
            notification_type,
            dm_chat_id="5619078117",
            group_chat_id="-1003711974679",
            tg_group_cutover=False,
        ) == ["-1003711974679"]


def test_dm_is_not_used_when_group_missing() -> None:
    assert resolve_chat_ids(
        "TYPE-3",
        dm_chat_id="5619078117",
        group_chat_id="",
        tg_group_cutover=True,
    ) == []
