|
@@ -54,7 +55,7 @@
|
{% if p.driver_id %}
{{ ico.i('check', 12) }}Ready
- {{ p.driver.original_filename }}
+ {{ p.driver.label }}
{% else %}
{{ ico.i('alert', 12) }}Driver needed
{% endif %}
diff --git a/imptune/templates/printers_new.html b/imptune/templates/printers_new.html
index 0b8156d..3b5572a 100644
--- a/imptune/templates/printers_new.html
+++ b/imptune/templates/printers_new.html
@@ -65,7 +65,7 @@
{% for item in driver_data %}
{% endfor %}
diff --git a/tests/e2e/test_theme_toggle.py b/tests/e2e/test_theme_toggle.py
index b47f73a..4e2a07f 100644
--- a/tests/e2e/test_theme_toggle.py
+++ b/tests/e2e/test_theme_toggle.py
@@ -7,9 +7,11 @@ def test_theme_cycles_on_click(page, live_server: str) -> None:
"""Clicking theme button cycles data-theme attribute: auto -> light -> dark -> auto."""
page.goto(f"{live_server}/", wait_until="domcontentloaded")
- # Initial state: auto (default from base.html)
+ # Initial state: auto — the attribute must be ABSENT, not "auto". Pico's
+ # OS-dark block is keyed on `:root:not([data-theme])`, so any value pins
+ # Pico to its light theme while app.css follows the OS into dark.
initial_theme = page.evaluate("document.documentElement.getAttribute('data-theme')")
- assert initial_theme == "auto"
+ assert initial_theme is None
# Click once -> light
page.click("button[aria-label='auto']")
@@ -27,6 +29,13 @@ def test_theme_cycles_on_click(page, live_server: str) -> None:
)
assert page.evaluate("document.documentElement.getAttribute('data-theme')") == "dark"
+ # Click again -> auto, which removes the attribute again
+ page.click("button[aria-label='dark']")
+ page.wait_for_function(
+ "!document.documentElement.hasAttribute('data-theme')",
+ timeout=2000,
+ )
+
def test_theme_persists_across_reload(page, live_server: str) -> None:
"""After clicking theme toggle, the chosen theme is restored on reload."""
|