Repository navigation
test: name undo tests for ⌘Z, and check bare z takes nothing back - #6491
Merged
Merged
Conversation
#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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#6429 moved undo from bare
zto ⌘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 forz.test_bare_z_takes_nothing_back_and_undo_still_doesintests/browser/test_render_outbox.pymakes a pick and waits until the page offers ⌘Z. It then presses barezand checks the pick stands. Finally it presses ⌘Z and checks the pick is taken back, with exactly oneundoevent in the log, naming the pick. Withztemporarily bound to undo again inbrowser/runtime/undo.js, the test fails at the "pick still stands" check.test_z_…becomestest_undo_…andtest_a_second_z_…becomestest_a_second_undo_…. That covers 16 tests intest_render_outbox.pyand one each inprojection/test_widget_actions.pyandtest_render_reactions.py. No assertion changes. Bareznow 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 checkandruff format --checkare clean.