from __future__ import annotations from pathlib import Path ROOT = Path(__file__).resolve().parents[2] def test_mobile_overflow_hardening_css_contracts() -> None: css = (ROOT / "frontend" / "src" / "styles" / "app.css").read_text(encoding="utf-8") assert "overflow-x: hidden;" in css assert ".workbench-shell" in css assert "max-width: 100vw;" in css assert ".workbench-sidebar nav" in css assert ".workspace-nav-cluster" in css assert ".inspector-tabs" in css assert "repeat(2, minmax(0, 1fr))" in css assert "overflow-x: clip;" in css assert "overscroll-behavior-x: contain;" in css assert ( "section > div:not(.map-controls):not(.feature-inspector):not(.quick-action-grid)" ":not(.geo-explorer-layout)" ) in css explorer_mobile_css = css.split("@media (max-width: 920px)", 1)[1] explorer_mobile_rule = explorer_mobile_css.split(".geo-explorer-layout", 1)[1] assert "display: block;" in explorer_mobile_rule.split("}", 1)[0] compact_mobile_css = css.rsplit("@media (max-width: 620px)", 1)[1] compact_theme_rule = compact_mobile_css.split(".geo-theme-list {", 1)[1].split("}", 1)[0] assert "max-height: 16rem;" in compact_theme_rule assert "overflow-y: auto;" in compact_theme_rule assert "overscroll-behavior-y: contain;" in compact_theme_rule def test_long_identifier_wrapping_contracts() -> None: css = (ROOT / "frontend" / "src" / "styles" / "app.css").read_text(encoding="utf-8") assert ".quality-check-dataset-link" in css assert ".quality-score-row strong" in css assert ".inspector-field strong" in css assert "overflow-wrap: anywhere;" in css assert "word-break: break-word;" in css