-
Notifications
You must be signed in to change notification settings - Fork 298
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
Niloofar Sadeghi / Refactor tests in the network-status.spec.tsx file #7230
Niloofar Sadeghi / Refactor tests in the network-status.spec.tsx file #7230
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
A production App ID was automatically generated for this PR. (log)
Click here to copy & paste above information.
|
Codecov Report
@@ Coverage Diff @@
## develop #7230 +/- ##
========================================
Coverage 19.40% 19.41%
========================================
Files 1478 1478
Lines 34569 34569
Branches 6366 6366
========================================
+ Hits 6709 6711 +2
+ Misses 27349 27348 -1
+ Partials 511 510 -1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
render(<NetworkStatus status={status} is_mobile />); | ||
const divElement = screen.getByTestId('dt_network_status_id'); | ||
expect(divElement).toHaveClass('network-status__wrapper--is-mobile'); | ||
rerender(<NetworkStatus status={{ class: 'online' }} />); |
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.
why do you need to run rerender on this?
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.
Thank u @ali-hosseini-fs for your revision
I'm passing different props in each render because of that I rerender the component
…ar/83404/tests-for-network-status
Kudos, SonarCloud Quality Gate passed! |
Changes:
Please include a summary of the change and which issue is fixed below:
When you need to add unit test
When you need to add integration test
Test coverage checklist (for reviewer)
Type of change