This commit is contained in:
@@ -0,0 +1,37 @@
|
|||||||
|
"""Navigation (#51) et bascule Dark/Light (#52).
|
||||||
|
|
||||||
|
L'accordéon de la barre latérale omettait la section admin :
|
||||||
|
le JS posait nav-closed-admin, mais aucun style ne la suivait.
|
||||||
|
Le thème clair, lui, doit être atteignable par un bouton et
|
||||||
|
mémorisé, avec les jetons draco clairs.
|
||||||
|
"""
|
||||||
|
|
||||||
|
|
||||||
|
def test_admin_accordion_closes(client, fake_gitea):
|
||||||
|
css = client.get("/static/css/style.css").text
|
||||||
|
assert 'body.nav-closed-admin [data-group="admin"] .side-acc' in css
|
||||||
|
assert 'body.nav-closed-admin [data-group="admin"] .side-chevron' in css
|
||||||
|
|
||||||
|
|
||||||
|
def test_theme_toggle_present_and_versioned(client, fake_gitea):
|
||||||
|
page = client.get("/")
|
||||||
|
assert 'id="theme-toggle"' in page.text
|
||||||
|
assert "Mode clair" in page.text
|
||||||
|
assert "/static/js/nav.js?v=" in page.text
|
||||||
|
|
||||||
|
|
||||||
|
def test_theme_js_contract(client, fake_gitea):
|
||||||
|
js = client.get("/static/js/nav.js").text
|
||||||
|
assert "kanbante-theme" in js
|
||||||
|
assert "theme-toggle" in js
|
||||||
|
assert "data-theme" in js
|
||||||
|
|
||||||
|
|
||||||
|
def test_light_theme_tokens(client, fake_gitea):
|
||||||
|
css = client.get("/static/css/style.css").text
|
||||||
|
assert 'html[data-theme="light"]' in css
|
||||||
|
assert "--bg: #f2f2f0;" in css
|
||||||
|
assert "--surface: #ffffff;" in css
|
||||||
|
assert "--accent-2: #a92e63;" in css
|
||||||
|
assert 'html[data-theme="light"] .draco-bar' in css
|
||||||
|
assert 'html[data-theme="light"] .card-menu' in css
|
||||||
Reference in New Issue
Block a user