-
Notifications
You must be signed in to change notification settings - Fork 4.7k
FormTokenField: use KeyboardEvent.code, refactor tests to model RTL and user-event #43442
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
Conversation
|
Size Change: +5 B (0%) Total Size: 1.24 MB
ℹ️ View Unchanged
|
432d5c1 to
fed3197
Compare
tyxla
left a comment
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'm in love with the way you write tests: elegant, eloquent, thorough, well-described, and easy to follow ❤️ Thanks a lot for your brilliant work here! 💯
I've left a few suggestions, but it's just minor optional stuff, this already looks ready to go.
🚀 🚢
a068b32 to
94e42d9
Compare
|
Thank you for your review, I'm humbled 🙇 All feedback has been addressed, will wait for CI to ✅ and merge |
Co-authored-by: Marin Atanasov <[email protected]>
Co-authored-by: Marin Atanasov <[email protected]>
94e42d9 to
9435de3
Compare
What?
FormTokenFieldcomponent to rely oncodeinstead ofkeyCodefor keyboard events.fireEvent, I went ahead and rewrote the whole test suite in TypeScript, usinguserEventand with "modern" RTL style (i.e. avoiding implementation details).__experimentalExpandOnFocusactually made the suggestions always visible (not just when focused)__experimentalAutoSelectFirstMatch's value changedOn top of that, here's list of things that I noticed and could be improved:
autoCompleteprop is listed as a value accepted by the component, but it doesn't seem to have any impact (since it gets overridden tooff)listboxelement can be rendered even if there are no suggestions passed via prop (for example, if the__experimentalExpandOnFocusis true and the component gets focused)titleattribute set)__experimentalRenderSuggestionwould probably be a better name for__experimentalRenderItem, and shoudl it allow for extra props?Why?
keyCodeis deprecated, and replaced bycodeWe're also rewriting our unit tests to RTL