test(nix): maximizing.user has toggle-monocle as both ports do

toggle-monocle leaves IGNORED: it turns the monocle of the tiles that
are left on and off while the window stays maximized, as probed on
komorebi for Windows.
This commit is contained in:
LGUG2Z committed 2026-10-30 18:54:19 -07:00
1 parent 3e7451f132
commit 7d19fd4045
3 files changed
+32 -5

No files matched your search

@@ -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",
-1
View File
@@ -24,7 +24,6 @@ ASKED_OF_THE_LAYOUT = (
"unstack",
"cycle-move",
"promote",
"toggle-monocle",
"resize-edge",
"send-to-workspace",
"move-to-workspace",
+1 -1
View File
@@ -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: