40 lines
1.4 KiB
Python
40 lines
1.4 KiB
Python
"""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 "/static/js/nav.js?v=" in page.text
|
|
# #55 : le bouton n'est plus dans l'en-tête applicatif.
|
|
head = page.text.split("header-actions", 1)[1].split("</header>", 1)[0]
|
|
assert 'id="theme-toggle"' not in head
|
|
|
|
|
|
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: #0f766e;" in css
|
|
assert 'html[data-theme="light"] .draco-bar' in css
|
|
assert 'html[data-theme="light"] .card-menu' in css
|