-
Notifications
You must be signed in to change notification settings - Fork 165
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
feat: revert code coverage on home page #614
feat: revert code coverage on home page #614
Conversation
- add test for home page content
- refactor testing on component/ui/alert/** - refactor testing on homepage-content
✔️ Deploy Preview for wargabantuwarga ready! 🔨 Explore the source changes: 5f679bb 🔍 Inspect the deploy log: https://app.netlify.com/sites/wargabantuwarga/deploys/611241a6e69b2a00083bf5d5 😎 Browse the preview: https://deploy-preview-614--wargabantuwarga.netlify.app |
Codecov Report
@@ Coverage Diff @@
## main #614 +/- ##
==========================================
+ Coverage 80.09% 80.17% +0.07%
==========================================
Files 115 115
Lines 1286 1286
Branches 418 418
==========================================
+ Hits 1030 1031 +1
+ Misses 250 249 -1
Partials 6 6
Continue to review full report at Codecov.
|
- refactor index test
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 reopening the #598 issue since many testing assertion issues still need to be addressed.
<HomePage latestNews={[latestNewsItemBuilder()]} />, | ||
); | ||
|
||
expect(container.firstChild?.hasChildNodes()).toBeTruthy(); |
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.
@antoooks We should use more robust assertions instead of just asserting the existence of a child node to avoid false positive test results.
FYI Mas @rubiagatra.
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.
ok @zainfathoni, will lookout for it on the weekend
@@ -7,6 +7,6 @@ describe("homepage content render correctly", () => { | |||
const { container } = render(<HomePageContent />); | |||
|
|||
it("renders correctly", () => { | |||
expect(container.firstChild).toHaveClass("flex-1"); | |||
expect(container.hasChildNodes()).toBeTruthy(); |
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.
@antoooks We should use more robust assertions instead of just asserting the existence of a child node to avoid false positive test results.
FYI Mas @rubiagatra.
expect(screen.getByRole("button")).toHaveClass( | ||
`close-button text-red-400 hover:text-red-500`, | ||
); | ||
|
||
fireEvent.click(screen.getByRole("button")); |
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.
@antoooks We should assert what should happen after the button is clicked.
FYI Mas @rubiagatra.
Closes #598
Description
Fixes unnecessary code coverage decrease from #604
Current Tasks