51 lines
1.7 KiB
Python
51 lines
1.7 KiB
Python
"""BUG-118 — barre d'apps commune en mobile (Fusion ACC-1, #215).
|
|
|
|
Retours de Bruno (2026-10-21) sur téléphone : la barre débordait
|
|
(pastilles domaines et onglets entiers affichés) et son bouton ☰
|
|
ne faisait rien — il cliquait le bouton bureau
|
|
``sidebar-toggle-btn`` au lieu du vrai hamburger mobile
|
|
``hamburger-btn``. Correctifs verrouillés ici : CSS commune v0.1.2
|
|
(palier 700 px resserré selon la spec) et rail contextuel dans
|
|
index.html (mobile ≤ 768 px → hamburger-btn).
|
|
"""
|
|
|
|
from pathlib import Path
|
|
|
|
FRONTEND = Path(__file__).resolve().parent.parent / "frontend"
|
|
|
|
|
|
def _css() -> str:
|
|
return (FRONTEND / "draco-barre.css").read_text(encoding="utf-8")
|
|
|
|
|
|
def _index() -> str:
|
|
return (FRONTEND / "index.html").read_text(encoding="utf-8")
|
|
|
|
|
|
def test_palier_mobile_resserre_v012():
|
|
css = _css()
|
|
assert "@media (max-width: 900px)" in css
|
|
# Seul l'onglet de l'app courante reste visible en mobile.
|
|
assert '.draco-bar[data-current="obsigate"] .draco-apptab[data-app="obsigate"]' in css
|
|
# Domaines et boutons icônes (rail, menu) masqués en mobile.
|
|
bloc = css.split("@media (max-width: 900px)", 1)[1]
|
|
assert ".draco-domaines" in bloc
|
|
assert "display: none" in bloc
|
|
|
|
|
|
def test_menu_des_applications_par_la_marque():
|
|
# v0.1.3 : la marque ✦ ouvre le menu des 4 applications
|
|
# (changement d'app en mobile), logo à 24 px.
|
|
html = _index()
|
|
assert 'data-act="apps"' in html
|
|
js = (FRONTEND / "draco-barre.js").read_text(encoding="utf-8")
|
|
assert "draco-apps-menu" in js
|
|
assert "font-size: 24px" in _css()
|
|
|
|
|
|
def test_rail_mobile_vers_le_vrai_hamburger():
|
|
html = _index()
|
|
assert 'matchMedia("(max-width: 768px)")' in html
|
|
assert '"hamburger-btn"' in html
|
|
assert '"sidebar-toggle-btn"' in html
|