aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_frontend.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-10 19:53:32 +0100
committerDanilo M. <danix@danix.xyz>2026-11-10 19:53:32 +0100
commitc75b6f1ff69d944bb07b9395880a63620a0a8a00 (patch)
tree85275188ebfbaf7863f0089b4644e089cd977604 /tests/test_frontend.py
parentd0c5ae2bf4a8a0ab1ddec409e007e7aef0dfc3e3 (diff)
downloaddeck-it-c75b6f1ff69d944bb07b9395880a63620a0a8a00.tar.gz
deck-it-c75b6f1ff69d944bb07b9395880a63620a0a8a00.zip
feat(dashboard): one fixed screen for the tablet
The Dashboard tab drops the draggable card grid for a fixed layout: a top band of system, Claude and tablet chips with trend and fill backgrounds, music and spending always on, a row of one to three busy modules (printer, build VM, OBS) that scroll long lines, and the action icons in Hyprland's rotating border. The stats, tablet and llm panels and the vendored Gridstack go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_frontend.py')
-rw-r--r--tests/test_frontend.py34
1 files changed, 18 insertions, 16 deletions
diff --git a/tests/test_frontend.py b/tests/test_frontend.py
index 635b57a..42126b8 100644
--- a/tests/test_frontend.py
+++ b/tests/test_frontend.py
@@ -69,8 +69,9 @@ class Frontend(unittest.TestCase):
status, body = self.get("/")
self.assertEqual(status, 200)
text = body.decode()
- for asset in ("app.js", "deck.css", "vendor/gridstack/gridstack-all.js"):
+ for asset in ("app.js", "deck.css"):
self.assertIn(asset, text)
+ self.assertNotIn("gridstack", text)
def test_pwa_manifest(self):
self.assertIn(b'rel="manifest"', self.get("/")[1])
@@ -80,9 +81,8 @@ class Frontend(unittest.TestCase):
for size in (192, 512):
self.assertEqual(self.get(f"/icon-{size}.png")[0], 200)
- def test_vendor_assets_served(self):
- for path in ("/vendor/gridstack/gridstack-all.js", "/vendor/gridstack/gridstack.min.css"):
- self.assertEqual(self.get(path)[0], 200, path)
+ def test_vendor_gridstack_is_gone(self):
+ self.assertEqual(self.get("/vendor/gridstack/gridstack-all.js")[0], 404)
def test_css_uses_udt_vars(self):
status, body = self.get("/deck.css")
@@ -96,16 +96,19 @@ class Frontend(unittest.TestCase):
for part in ("export default", "mount", "update"):
self.assertIn(part, text, name)
- def test_panel_for_every_module(self):
- from deckit.modules import build
- names = [m["name"] for m in build({}).names()]
- self.assertIn("stats", names)
- for name in names:
+ def test_panels(self):
+ # Tabs and the music card have panels; stats, tablet, llm and actions
+ # are drawn by dashboard.js; k1c, sbbuilder and obs give it a slot.
+ for name in ("music", "k1c", "obs", "windows", "assistant"):
self.assert_panel(name)
+ for name in ("k1c", "sbbuilder", "obs"):
+ text = self.get(f"/modules/{name}.js")[1].decode()
+ self.assertIn("export const busy", text, name)
+ self.assertIn("export function slot", text, name)
+ self.assertEqual(self.get("/dashboard.js")[0], 200)
def test_panels_have_their_scoped_wrapper(self):
self.assertIn(b'class="music"', self.get("/modules/music.js")[1])
- self.assertIn(b'class="sbb"', self.get("/modules/sbbuilder.js")[1])
def test_tabbed_shell(self):
self.assertIn(b'id="tabs"', self.get("/")[1])
@@ -117,12 +120,11 @@ class Frontend(unittest.TestCase):
self.assertIn(b'tab: "OBS"', self.get("/modules/obs.js")[1])
self.assertIn(b'tab: "Windows"', self.get("/modules/windows.js")[1])
- def test_layout_is_browser_local(self):
- status, body = self.get("/app.js")
- self.assertEqual(status, 200)
- text = body.decode()
- for part in ("GridStack", "localStorage", "deckit.layout", "gs-id"):
- self.assertIn(part, text)
+ def test_dashboard_is_one_fixed_screen(self):
+ text = self.get("/app.js")[1].decode()
+ self.assertIn("dashboard.js", text)
+ for gone in ("GridStack", "deckit.layout", "deckit.folded"):
+ self.assertNotIn(gone, text)
if __name__ == "__main__":