-
Notifications
You must be signed in to change notification settings - Fork 10
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
FEI-5533: Re-enable select keyboard tests for Dropdown and Clickable #2420
Open
marcysutton
wants to merge
9
commits into
feature/dropdown-combobox
Choose a base branch
from
FEI-5533-part1
base: feature/dropdown-combobox
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 5 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
25bbdf2
Fix some keyboard tests with normalized keyCodes
marcysutton 631850f
docs(changeset): Fixes keyboard tests in Dropdown and Clickable
marcysutton b4bc2b7
[FEI-5533-part1] Update changelog with additional details
marcysutton 674d872
[FEI-5533-part1] Disable keyboard story in Chromatic
marcysutton b3bc70a
[FEI-5533-part1] PR feedback:
marcysutton 226b4e7
[FEI-5533-part1] Re-enables passing tests or adds notes to fails
marcysutton 3eea444
[FEI-5533-part1] Update changeset to indicate major breaking change
marcysutton aa8c34f
[FEI-5533-part1] Use " " over "{Space}" to match browser behavior
marcysutton 2ada9bd
[FEI-5533-part1] Use Capital case Escape to match key constants
marcysutton 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
"@khanacademy/wonder-blocks-clickable": minor | ||
"@khanacademy/wonder-blocks-dropdown": minor | ||
"@khanacademy/wonder-blocks-core": minor | ||
--- | ||
|
||
Fixes keyboard tests in Dropdown and Clickable with specific key events. We now check event.key instead of event.which or event.keyCode to match the keys returned from Testing Library/userEvent. |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
/** | ||
* Key value mapping reference: | ||
* https://developer.mozilla.org/en-US/docs/Web/API/UI_Events/Keyboard_event_key_values | ||
*/ | ||
export const keys = { | ||
enter: "Enter", | ||
escape: "Escape", | ||
tab: "Tab", | ||
space: "Space", | ||
up: "ArrowUp", | ||
down: "ArrowDown", | ||
} as const; |
Oops, something went wrong.
Oops, something went wrong.
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.
Related to our thread about versioning in the other PR, would this also be a breaking change if consumer projects were relying on the
event.which/event.keyCode
functionality?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.
Great question. I think yes, and this could be released along with the other breaking changes. So it's good timing!
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.
Hmm, now I'm rethinking
major
on this and wondering ifminor
is more appropriate. The move toevent.key
is internal, and not part of the public API. Curious to hear your thoughts @beaesguerra!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.
Looks like I marked the similar event.key change for the SelectOpener as a
patch
change 😅 I think it is fine that we don't mark it asmajor
since it is internal. It would be good to double check these areas in current usage though just to be sure there wasn't functionality relying on that!And since this would be released with the other combobox changes, it'll be part of the new major version as you mentioned!