aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/test_windows.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_windows.py b/tests/test_windows.py
index 6aa7925..ca9be71 100644
--- a/tests/test_windows.py
+++ b/tests/test_windows.py
@@ -28,6 +28,21 @@ class Commands(unittest.TestCase):
st = windows._state(lambda cmd: responses[tuple(cmd)])
self.assertEqual(st["workspaces"], [1, 2, 5])
+ def test_state_includes_empty_workspaces_and_launch_icons(self):
+ responses = {
+ ("hyprctl", "clients", "-j"): "[]",
+ ("hyprctl", "activewindow", "-j"): "{}",
+ ("hyprctl", "workspaces", "-j"): '[{"id": 3}]',
+ }
+ m = windows.make({
+ "windows": {"workspaces": [1, 2, 3, 4]},
+ "launch": {"obs": {"icon": "obsstudio", "command": "obs"}},
+ "run": lambda cmd: responses[tuple(cmd)],
+ })
+ st = m.state()
+ self.assertEqual(st["workspaces"], [1, 2, 3, 4])
+ self.assertEqual(st["launches"], [{"key": "obs", "icon": "obsstudio", "label": "obs"}])
+
if __name__ == "__main__":
unittest.main()