diff --git a/nix/tests/vm/lib/komorebi_vm/core/scenarios/maximizing.py b/nix/tests/vm/lib/komorebi_vm/core/scenarios/maximizing.py index 6aa038a9..58379ada 100644 --- a/nix/tests/vm/lib/komorebi_vm/core/scenarios/maximizing.py +++ b/nix/tests/vm/lib/komorebi_vm/core/scenarios/maximizing.py @@ -60,8 +60,9 @@ def run(platform: Platform, checks: Checks, clients: list[Client]) -> None: # What is asked of the layout, which a maximized window is not in: none of it does anything. Not in # the list, because komorebi for Windows does not ignore them either: `toggle-float`, which floats -# the maximized window (`user` ends with it), and `stack left` and `stack right`, which stack the -# tiles that are left. +# the maximized window (`user` ends with it), `stack left` and `stack right`, which stack the tiles +# that are left, and `toggle-monocle`, which turns the monocle of the tiles that are left on while +# the window stays maximized (`user` has it too). IGNORED = ( "move left", "move right", @@ -70,7 +71,6 @@ IGNORED = ( "unstack", "cycle-move next", "promote", - "toggle-monocle", "resize-edge left increase", "send-to-workspace 1", "move-to-workspace 1", @@ -135,6 +135,34 @@ def user(platform: Platform, checks: Checks, clients: list[Client]) -> None: containers() == count - 1 and workspace.floating == [] and workspace.monocle is None, ) + # `toggle-monocle` is not ignored: the monocle of the tiles that are left comes on and goes off, + # and the window stays maximized, as on komorebi for Windows + platform.komorebic("toggle-monocle") + checks.check( + "toggle-monocle turns the monocle of the tiles that are left on, and the window stays" + " maximized", + platform.wait_for( + lambda: ( + platform.state().workspace().monocle is not None and maximized() == target.title + ), + timeout=20, + ) + and fills(target), + ) + platform.komorebic("toggle-monocle") + checks.check( + "... and again turns it off, with the window still maximized", + platform.wait_for( + lambda: ( + platform.state().workspace().monocle is None + and maximized() == target.title + and containers() == count - 1 + ), + timeout=20, + ) + and fills(target), + ) + platform.komorebic("toggle-maximize") checks.check( f"toggle-maximize restores it: nothing is maximized and {target.title} is in its tile", diff --git a/nix/tests/vm/lib/tests/fake_platform.py b/nix/tests/vm/lib/tests/fake_platform.py index 1cc79884..0be9d2ca 100644 --- a/nix/tests/vm/lib/tests/fake_platform.py +++ b/nix/tests/vm/lib/tests/fake_platform.py @@ -24,7 +24,6 @@ ASKED_OF_THE_LAYOUT = ( "unstack", "cycle-move", "promote", - "toggle-monocle", "resize-edge", "send-to-workspace", "move-to-workspace", diff --git a/nix/tests/vm/lib/tests/test_moved.py b/nix/tests/vm/lib/tests/test_moved.py index 45571a2a..675bd9d6 100644 --- a/nix/tests/vm/lib/tests/test_moved.py +++ b/nix/tests/vm/lib/tests/test_moved.py @@ -303,7 +303,7 @@ def test_a_daemon_that_takes_up_a_maximize_passes_user_maximize() -> None: base = checks.passed maximizing.user(platform, checks, clients) assert checks.failed == 0, checks.failures - assert checks.passed - base == 10 + assert checks.passed - base == 12 def test_a_daemon_that_obeys_commands_when_maximized_fails_user_maximize() -> None: