-
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
Increase code covergae for OverFlowMenuV2 #17884
base: main
Are you sure you want to change the base?
Increase code covergae for OverFlowMenuV2 #17884
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. |
✅ 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 #17884 +/- ##
==========================================
+ Coverage 80.35% 80.48% +0.13%
==========================================
Files 406 406
Lines 14041 14041
Branches 4395 4367 -28
==========================================
+ Hits 11282 11301 +19
+ Misses 2593 2574 -19
Partials 166 166 ☔ 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.
Hey thanks for taking a look at this! Rather than mocking the various components, these tests would be more valuable if they ensured the real code works as expected. Meaning if you render()
something like what's shown/documented in storybook:
<OverflowMenuV2>
<CustomMenuItem />
<MenuItem label="Stop app" />
<MenuItemDivider />
<MenuItem label="Delete app" kind="danger" />
</OverflowMenuV2>
We'd want to assert that
console.warn
is called as expected with the deprecation warninguseFeatureFlag('enable-v12-overflowmenu')
returnstrue
from withinCustomMenuItem
- Everything is passed through and spread onto the new implementation of OverflowMenu, meaning new OverflowMenu props such as
autoAlign
are able to be set and have the proper result (auto align class is present) and the children MenuItem are rendered okay likeexpect(getByText('Stop app')).toBeInTheDocument();
This way the only thing you'll need to mock is the implementation of console.warn.
Closes #17507
Increase code coverage for overflowmenuv2