"""Tests for normalize_phone()."""
from kwtsms import normalize_phone


def test_strips_plus_prefix():
    assert normalize_phone("+96598765432") == "96598765432"


def test_strips_double_zero_prefix():
    assert normalize_phone("0096598765432") == "96598765432"


def test_strips_spaces():
    assert normalize_phone("965 9876 5432") == "96598765432"


def test_strips_dashes():
    assert normalize_phone("965-9876-5432") == "96598765432"


def test_converts_arabic_indic_digits():
    # ٩٦٥٩٨٧٦٥٤٣٢ = 96598765432 in Arabic-Indic
    assert normalize_phone("٩٦٥٩٨٧٦٥٤٣٢") == "96598765432"


def test_strips_leading_zeros_after_00_prefix():
    assert normalize_phone("00 965 9876-5432") == "96598765432"


def test_empty_string():
    assert normalize_phone("") == ""


def test_digits_only_unchanged():
    assert normalize_phone("96598765432") == "96598765432"
