-
Notifications
You must be signed in to change notification settings - Fork 53
Add tests for useTabs hook #1137
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
base: main
Are you sure you want to change the base?
Conversation
|
🟢 No design token changes found |
🟢 Unit test coverage changes foundUnit test coverage has been updated through this PR. Changes: 1 new tests, 0 removed tests, 0 improved, 0 decreased
|
🟢 No visual differences foundOur visual comparison tests did not find any differences in the UI. |
7ea36b0
to
3ea3747
Compare
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.
Pull Request Overview
This PR adds comprehensive test coverage for the useTabs
hook to achieve 100% code coverage. The tests validate all aspects of the hook's functionality including tab activation, keyboard navigation, accessibility attributes, and event handling.
Key Changes
- Creates a complete test suite with 1,229 lines covering all hook behaviors
- Implements a custom hook testing utility that simulates real DOM interactions
- Tests all keyboard navigation patterns, accessibility compliance, and edge cases
6842b42
to
ae060a0
Compare
ae060a0
to
a3cd51a
Compare
Summary
Backfills tests for useTabs hook to bring coverage up to (nearly) 100%.
These tests highlighted some incorrect types in the useTabs hook which I plan to resolve in a subsequent PR (#1138), keeping this PR focused on coverage.
The recent modifications made to this hook in the recently merged Tabs component PR have introduced a line which is proving tricky to test. The subsequent PR mentioned above will address that and bring coverage up to 100%, which isn't possible here as it will require a modification to the hook's implementation.
Supporting resources (related issues, external links, etc)
Contributor checklist
update snapshots
label to the PR)Reviewer checklist