feat(11-03): Alpine.js theme + i18n stores in base.html with top-right controls
- Add Alpine.store('theme') for Light/Dark/System cycling with localStorage persistence
- Add Alpine.store('i18n') with FR/EN translations for all static UI strings
- Add topbar with theme toggle button (:aria-label, @click cycle) and lang button
- Wrap main content in .main-wrapper + .topbar for layout structure
- Add .main-wrapper, .topbar, .topbar-controls styles to app.css
- Add test_theme_toggle_present integration test
- Fix test_dashboard_shows_recent_printers assertion (string now in i18n JS too)
This commit is contained in:
+21
-1
@@ -43,6 +43,16 @@ def test_packages_returns_200(client):
|
||||
assert response.status_code == 200
|
||||
|
||||
|
||||
|
||||
def test_theme_toggle_present(client):
|
||||
"""GET / contains a theme toggle button (data-theme cycling control)."""
|
||||
response = client.get("/")
|
||||
assert response.status_code == 200
|
||||
# The button's @click should reference $store.theme.cycle
|
||||
assert "theme" in response.text
|
||||
assert "cycle" in response.text or "store.theme" in response.text
|
||||
|
||||
|
||||
def test_dashboard_shows_recent_printers(client):
|
||||
"""Dashboard renders names of recently-created printers from DB."""
|
||||
from imptune.db.models import Printer
|
||||
@@ -62,7 +72,17 @@ def test_dashboard_shows_recent_printers(client):
|
||||
assert response.status_code == 200
|
||||
assert "TestPrinter-Alpha" in response.text
|
||||
assert "TestPrinter-Beta" in response.text
|
||||
assert "No printers configured yet" not in response.text
|
||||
# Use class-specific check: the string also appears in the i18n store JS
|
||||
assert 'class="empty-state">No printers configured yet' not in response.text
|
||||
|
||||
|
||||
def test_theme_toggle_present(client):
|
||||
"""GET / contains a theme toggle button (data-theme cycling control)."""
|
||||
response = client.get("/")
|
||||
assert response.status_code == 200
|
||||
# The button's @click should reference $store.theme.cycle
|
||||
assert "theme" in response.text
|
||||
assert "cycle" in response.text or "store.theme" in response.text
|
||||
|
||||
|
||||
def test_dashboard_shows_recent_packages(client):
|
||||
|
||||
Reference in New Issue
Block a user