-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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. |
||
}); | ||
}); |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,12 +52,15 @@ describe("Alert", () => { | |
"border-red-400", | ||
); | ||
expect(container.firstChild?.firstChild).toHaveClass("p-4", "babayaga"); | ||
|
||
expect( | ||
container.firstChild?.firstChild?.firstChild?.firstChild?.firstChild, | ||
).toHaveClass("flex-shrink-0 mr-3"); | ||
expect( | ||
container.firstChild?.firstChild?.firstChild?.childNodes[1], | ||
).toHaveClass(`close-button text-red-400 hover:text-red-500`); | ||
container.getElementsByClassName("flex-shrink-0 mr-3")[0].hasChildNodes(), | ||
).toBeTruthy(); | ||
|
||
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 commentThe 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. |
||
}); | ||
}); |
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