[UEPR-483] Action Menu Tests#452
Open
kbangelov wants to merge 21 commits intoscratchfoundation:release/UEPR-297-accessibility-improvementsfrom
Open
[UEPR-483] Action Menu Tests#452kbangelov wants to merge 21 commits intoscratchfoundation:release/UEPR-297-accessibility-improvementsfrom
kbangelov wants to merge 21 commits intoscratchfoundation:release/UEPR-297-accessibility-improvementsfrom
Conversation
KManolov3
reviewed
Feb 24, 2026
| expect(document.activeElement).toBe(mainButton); | ||
| }); | ||
|
|
||
| test('tab closes menu and focuses next element', async () => { |
Contributor
There was a problem hiding this comment.
Maybe we can add a test for shift + tab as well
|
|
||
| // Wait 1 second for any menu close animations or timeouts | ||
| await new Promise(resolve => setTimeout(resolve, 1000)); | ||
| expect(document.activeElement).toBe(afterButton); |
Contributor
There was a problem hiding this comment.
Would we also want to check whether the menu is closed as well?
| act(() => { | ||
| fireEvent.keyDown(firstItem, {key: KEY.ESCAPE}); | ||
| }); | ||
| expect(document.activeElement).toBe(mainButton); |
Contributor
There was a problem hiding this comment.
Here as well - the test name implies we check that the menu is closed, but we only check whether the focus has moved
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.
STILL AWAITING MERGE OF #433
Resolves
Part of https://scratchfoundation.atlassian.net/browse/UEPR-483
Proposed Changes
3 Unit tests to test keyboard navigation.
Reason for Changes
Part of Accessibility initiative for Scratch.