from pathlib import Path

SCRIPT = Path("scripts/probe_jasmin_print_layout_catalog.py")


def test_probe_script_exists_and_is_readonly_by_default():
    text = SCRIPT.read_text(encoding="utf-8")
    assert "probe_jasmin_print_layout_catalog" in text
    assert "DEFAULT_LABELS" in text
    assert "Fatura de Mercadorias" in text
    assert "Talão de Fatura" in text
    assert "CATALOG_ENDPOINTS" in text
    assert "--probe-print-post" in text
    assert "--confirm-invoice" in text
    assert "POST /print" in text
    # Default catalog probe must not create invoices.
    assert "fromQuotation" not in text
    assert "create_invoice" not in text


def test_probe_writes_standard_outputs():
    text = SCRIPT.read_text(encoding="utf-8")
    assert "/tmp/clientflow_jasmin_print_layout_catalog_probe" in text
    assert ".json" in text
    assert ".md" in text
    assert ".csv" in text
