Repository navigation
editor: item-surface move test turns snapping off for every context - #1199
Merged
Merged
Conversation
Its poses are asserted raw, but it read whatever snapping a previous suite left behind: in another file order (private-editor's CI) a leaked interaction scope put the move in a grid-snapped context and three poses snapped. The test now sets every context off and restores them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
What does this PR do?
item-surface-move.test.tsasserts raw item poses, but it relied on whatever snapping state a previous test file left behind. In a different file order (private-editor's CI, which reruns the editor packages at a new pin) a leaked interaction scope put the move into a grid-snapped context, and three tests failed (0.7 → 0.5, -0.5 → -0.25, 4.33 → 4.14). The test now sets every snapping context off inbeforeEachand restores them inafterEach. Test-only change.How to test
bun test src/components/tools/registry/item-surface-move.test.tsinpackages/editor: 18 pass.room-dividescope running before it: 3 failures without this change, 0 with it.Screenshots / screen recording
N/A — non-visual change
Checklist
bun devbun checkto verify)mainbranch🤖 Generated with Claude Code
Note
Low Risk
Test harness isolation only; no application or editor runtime code paths change.
Overview
Fixes order-dependent failures in
item-surface-move.test.tsby resetting editor snapping before each test and restoring it after.The suite checks raw hosted item poses (e.g. grab math at
0.7,-0.5). When another file leaves an interaction scope with grid snapping on, those values get quantized and assertions break under different CI test order.beforeEachnow forcessnappingModeByContexttoofffor every known context;afterEachputs the prior map back so other suites are unaffected.Test-only change—no production behavior.
Reviewed by Cursor Bugbot for commit f9e8aa4. Bugbot is set up for automated code reviews on this repo. Configure here.