-
Notifications
You must be signed in to change notification settings - Fork 3.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(tests): contextMenuSelect sometimes clicks the wrong block #7485
Merged
rachel-fenichel
merged 7 commits into
google:develop
from
rachel-fenichel:clickableElement
Sep 13, 2023
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
6d63f3c
feat(tests): add helper to get a clickable element on a block
rachel-fenichel 1f5dc25
fix(tests): use new helper function for right-clicks
rachel-fenichel 6a920a8
fix(tests): use new helper function for right-clicks
rachel-fenichel 8d6eb80
chore(tests): use new helper function in delete tests
rachel-fenichel cad3d4b
chore(tests): format
rachel-fenichel 5ee26c9
feat: use block instead of block ID in getClickableBlockElement
rachel-fenichel 67f42f0
chore(tests): rewrite getClickableBlockElement as clickBlock
rachel-fenichel File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In general I think it's easiest if we pass the block element (which has an ID property) around to all of our helpers. This makes the code more consistent, and makes it easier for us to refactor the test helpers if we need to, because it's less likely we have to change test code as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is true for cases where we're creating the blocks by dragging from the flyout but false for cases where we create blocks by loading from JSON or XML. In the tests above, all of the basic playground tests and some of the delete tests create blocks from the flyout, but the other delete tests load from XML and just use a block ID to find the blocks. As I see it, every time we have a handle on a block we also have a handle on the block's ID, but the opposite is not guaranteed to be true.
Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think for those cases you can just get the block by ID using our helper for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.