Skip to content

test: name undo tests for ⌘Z, and check bare z takes nothing back - #6491

Merged
max-sixty merged 1 commit into
mainfrom
test/undo-key-names
Nov 19, 2026
Merged

max-sixty merged 1 commit into
mainfrom
test/undo-key-names

Conversation

@leaf-agent

Copy link
Copy Markdown
Collaborator

#6429 moved undo from bare z to ⌘Z (Ctrl+Z off a Mac), so that typing a word with a "z" in it onto the page no longer takes back the user's last gesture. No test protected that move. This PR adds one, and renames the 18 undo tests still named for z.

  • New test: test_bare_z_takes_nothing_back_and_undo_still_does in tests/browser/test_render_outbox.py makes a pick and waits until the page offers ⌘Z. It then presses bare z and checks the pick stands. Finally it presses ⌘Z and checks the pick is taken back, with exactly one undo event in the log, naming the pick. With z temporarily bound to undo again in browser/runtime/undo.js, the test fails at the "pick still stands" check.
  • Renames: test_z_… becomes test_undo_… and test_a_second_z_… becomes test_a_second_undo_…. That covers 16 tests in test_render_outbox.py and one each in projection/test_widget_actions.py and test_render_reactions.py. No assertion changes. Bare z now means "scroll the current item to the top", so the old names pointed at a different command. Nothing else in the tree refers to the old names.

Verification: the new test and a renamed one pass by node id, and ruff check and ruff format --check are clean.

#6429 moved undo from bare `z` to ⌘Z (Ctrl+Z off a Mac), so typing a word
with a "z" onto the page no longer takes back gestures; bare `z` now aligns
the current item at the top. The tests already pressed ⌘Z through `undo(page)`
but kept `test_z_…` names. Rename them to `test_undo_…` /
`test_a_second_undo_…`, assertions unchanged.

Add test_bare_z_takes_nothing_back_and_undo_still_does: after a pick, with
focus released to the page and ⌘Z offered, a bare `z` leaves the pick standing
and writes no undo; the ⌘Z after it takes the pick back, and the log holds that
one withdrawal only. It guards the behavior #6429 introduced rather than fixing
anything: binding `z` to undo again makes it fail.
@max-sixty
max-sixty merged commit 965296b into main Nov 19, 2026
6 checks passed
@max-sixty
max-sixty deleted the test/undo-key-names branch November 19, 2026 07:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants