aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_gui.py
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-19 19:25:01 +0200
committerDanilo M. <danix@danix.xyz>2026-10-19 19:25:01 +0200
commit14180a2c200c4b7aba23a6d34be8b3af9f682f70 (patch)
treed0a4b956f3522ad0d111b5d461bbd4fdda3131eb /tests/test_gui.py
parentc142168019f61776ba612fa05ac6a0adb17ba1e2 (diff)
downloadsb-builder-14180a2c200c4b7aba23a6d34be8b3af9f682f70.tar.gz
sb-builder-14180a2c200c4b7aba23a6d34be8b3af9f682f70.zip
Redesign the Dashboard as cards with stat tiles
The tiles were plain group boxes of key: value text and read as text scattered on a page. Now a KPI row (packages, built, last pull, VM load) with large values and muted details, a slackrepo results stacked bar in the reserved status colors with hover counts and a labelled legend, and a recent jobs card. Colors come from the Qt palette, so the user's theme applies. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'tests/test_gui.py')
-rw-r--r--tests/test_gui.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/tests/test_gui.py b/tests/test_gui.py
index 16b83c0..5b233fb 100644
--- a/tests/test_gui.py
+++ b/tests/test_gui.py
@@ -133,9 +133,12 @@ class SmokeTest(unittest.TestCase):
w.poll_jobs()
self.assertEqual(w.conn.text(), "● connected")
self.assertEqual(w.tabs.tabText(0), "Dashboard")
- self.assertIn("total: 10", w.dashboard.labels["Repo"].text())
- self.assertEqual(w.dashboard.labels["slackrepo"].text(), "n/a")
- self.assertIn("10.0 GiB", w.dashboard.labels["VM"].text())
+ tiles = w.dashboard.tiles
+ self.assertEqual(tiles["Packages"].value.text(), "10")
+ self.assertEqual(tiles["Packages"].detail.text(), "2\u00a0personal · 1\u00a0pentesting · 1\u00a0shadowed")
+ self.assertEqual(tiles["Built"].value.text(), "n/a")
+ self.assertIn("10.0 GiB free", tiles["VM load"].detail.text())
+ self.assertEqual(w.dashboard.legend.text(), "n/a")
jobs = w.open_jobs()
self.assertIs(w.open_jobs(), jobs)
self.assertEqual(w.tabs.count(), 2)
@@ -157,6 +160,14 @@ class SmokeTest(unittest.TestCase):
self.assertEqual(w.conn.text(), "● VM off")
self.assertFalse(w.vm_btn.isHidden())
+ def test_results_bar(self):
+ w, _ = self.window(stats=(dict(STATS, slackrepo={"results": {"failed": 1, "ok": 3, "removed": 1},
+ "built": 4}), None))
+ w.poll_jobs()
+ self.assertEqual([(label, n) for label, n, _ in w.dashboard.bar.parts],
+ [("ok", 3), ("failed", 1), ("removed", 1)])
+ self.assertEqual(w.dashboard.tiles["Built"].detail.text(), "of 10 · 6 never built")
+
def test_close_jobs_tab_while_following(self):
# regression: the follow process ended after the tab was deleted, its
# finished slot touched dead widgets and PyQt aborted the app