"""Smoke layer (TS-21): the installed wheel imports and its whole public surface is reachable.

Tier-0, browser-free — the build-broken detector. If a refactor drops a name from
``__all__`` or breaks an import, this fails in under a second.
"""

from __future__ import annotations

import pytest

import mgf.uitest_web as pkg


@pytest.mark.smoke
def test_package_imports_and_declares_a_version() -> None:
    assert isinstance(pkg.__version__, str)
    assert pkg.__version__


@pytest.mark.smoke
def test_every_public_name_is_reachable() -> None:
    missing = [name for name in pkg.__all__ if not hasattr(pkg, name)]
    assert not missing, f"declared in __all__ but not importable: {missing}"


@pytest.mark.smoke
def test_all_is_sorted_and_unique() -> None:
    assert list(pkg.__all__) == sorted(pkg.__all__)
    assert len(pkg.__all__) == len(set(pkg.__all__))
