From d0ba39bf0145c2965feb6e083b16d12a7da217b0 Mon Sep 17 00:00:00 2001 From: bruno Date: Thu, 29 Oct 2026 12:27:53 -0400 Subject: [PATCH] =?UTF-8?q?Page=20Projets=20:=20copie=20URL=20dans=20le=20?= =?UTF-8?q?menu=20=E2=8B=AF=20+=20refonte=20th=C3=A8me=20barre=20Fusion/Sp?= =?UTF-8?q?ark=20(#44,=20#45)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/test_mobile.py | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 tests/test_mobile.py diff --git a/tests/test_mobile.py b/tests/test_mobile.py new file mode 100644 index 0000000..7be186f --- /dev/null +++ b/tests/test_mobile.py @@ -0,0 +1,35 @@ +"""Mobile : tiroir, pied et menu compte. + +Bugs signalés sur captures (29 octobre 2026) : +- tiroir rétréci à 68 px en mobile quand l'état « replié » desktop + était mémorisé (spécificité de `body.sidebar-collapsed .sidebar`) ; +- pied de sidebar masqué en mobile (`display: none`) ; +- Profil / Déconnexion du menu compte draco sans effet (onAction + ne les prenait pas en charge). +""" + + +def test_tiroir_mobile_largeur_fixe(): + css = open("static/css/style.css", encoding="utf-8").read() + assert "body.sidebar-collapsed .sidebar,\n body.sidebar-open.sidebar-collapsed .sidebar { width: 264px; }" in css + assert "body.sidebar-open { overflow: hidden; }" in css + + +def test_pied_visible_en_mobile(): + css = open("static/css/style.css", encoding="utf-8").read() + assert ".side-foot { display: none; }" not in css + assert "body.sidebar-collapsed .side-foot-meta { display: flex; }" in css + + +def test_menu_compte_draco_fonctionnel(): + tpl = open("app/templates/_draco_bar.html", encoding="utf-8").read() + assert 'act === "profil"' in tpl + assert 'location.href = "/profile"' in tpl + assert 'act === "deconnexion"' in tpl + assert 'location.href = "/logout"' in tpl + + +def test_tiroir_ferme_en_mobile(): + js = open("static/js/nav.js", encoding="utf-8").read() + assert "window.innerWidth <= 900" in js + assert "querySelectorAll('.side-link')" in js