-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
test(Dropdown): increase test coverage to 100% for Dropdown component #17785
test(Dropdown): increase test coverage to 100% for Dropdown component #17785
Conversation
✅ Deploy Preview for v11-carbon-web-components ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for carbon-elements ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
✅ Deploy Preview for v11-carbon-react ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #17785 +/- ##
==========================================
+ Coverage 79.72% 80.08% +0.36%
==========================================
Files 406 406
Lines 14012 14011 -1
Branches 4333 4380 +47
==========================================
+ Hits 11171 11221 +50
+ Misses 2676 2624 -52
- Partials 165 166 +1 ☔ View full report in Codecov by Sentry. |
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 good to me!
Co-authored-by: andrew <emyarod@users.noreply.github.com>
f2c4993
Closes #17477
test(Dropdown): increase test coverage to 100% for Dropdown component
Changelog
New
true
andfalse
true
|false
Changed
Removed
Testing / Reviewing
Test coverage has been increased to 100%, up from the previous 75%. I added mock tests for areas that were not covered in the earlier tests.
PASS packages/react/src/components/Dropdown/tests/Dropdown-test.js
Dropdown
✓ should initially render with the menu not open (19 ms)
✓ should let the user open the menu by clicking on the control (35 ms)
✓ should render with strings as items (16 ms)
✓ should render custom item components (14 ms)
✓ should render selectedItem as an element (3 ms)
✓ should render selectedItem as an element of type number (12 ms)
✓ should render when defaulItemtoString passed with null value (2 ms)
✓ should let the user select an option by clicking on the option node (43 ms)
✓ should respect readOnly prop (27 ms)
✓ should respect readOnly prop with false and respect call setTimeout function (15 ms)
✓ should respect readOnly prop with false argument and respect clear activated Timeout (9 ms)
✓ should initially render with the menu not open (1 ms)
title
✓ renders a title (2 ms)
✓ has the expected classes (2 ms)
helper
✓ renders a helper (2 ms)
✓ renders children as expected (6 ms)
should display initially selected item found in
initialSelectedItem
✓ using an object type for the
initialSelectedItem
prop (2 ms)✓ using a string type for the
initialSelectedItem
prop (1 ms)Component API
✓ should accept a
ref
for the underlying button element (1 ms)✓ should respect slug prop (3 ms)
DropdownSkeleton
Renders as expected
✓ Has the expected classes (1 ms)
Test useEffect
✓ for auto-align features (18 ms)
--------------|---------|----------|---------|---------|-------------------------------------------------------------------------