-
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: remove last updated alert from homepage #604
feat: remove last updated alert from homepage #604
Conversation
- remove LastUpdatedAlert component from homepage - remove widget from netlify-cms config - fix testing
✔️ Deploy Preview for wargabantuwarga ready! 🔨 Explore the source changes: 3a3319b 🔍 Inspect the deploy log: https://app.netlify.com/sites/wargabantuwarga/deploys/6110e924ec09e7000814003c 😎 Browse the preview: https://deploy-preview-604--wargabantuwarga.netlify.app |
Codecov Report
@@ Coverage Diff @@
## main #604 +/- ##
==========================================
+ Coverage 79.57% 79.69% +0.12%
==========================================
Files 110 110
Lines 1268 1266 -2
Branches 418 418
==========================================
Hits 1009 1009
+ Misses 253 251 -2
Partials 6 6
Continue to review full report at Codecov.
|
following PR kawalcovid19#604
- fix test case naming
- remove test altogether
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
But the codecov still failed.
Help to fix it first, Mostly on components/ui/alert/**
- improve code coverage on components/ui/alert/**
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.
We shouldn't decrease the test coverage of any well-covered code. 😅
I'm reopening #598 issue to restore the test properly.
describe("HomePage", () => { | ||
it("renders the last updated time correctly", () => { | ||
render(<HomePage latestNews={[latestNewsItemBuilder()]} />); | ||
|
||
expect( | ||
screen.getByText( | ||
/Pembaruan terakhir pada Selasa, 27 Juli 2021 17.43 WIB/i, | ||
), | ||
).toBeVisible(); | ||
}); | ||
}); | ||
|
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.
Thanks for working on it, @antoooks.
Hiwever, this test removal reduced the code coverage of the home page. Please put it back and change the assertion instead.
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 have more requests to fix the way we're testing the components here.
@@ -45,5 +52,12 @@ describe("Alert", () => { | |||
"border-red-400", | |||
); | |||
expect(container.firstChild?.firstChild).toHaveClass("p-4", "babayaga"); | |||
expect( | |||
container.firstChild?.firstChild?.firstChild?.firstChild?.firstChild, |
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.
container.firstChild?.firstChild?.firstChild?.firstChild?.firstChild, | ||
).toHaveClass("flex-shrink-0 mr-3"); | ||
expect( | ||
container.firstChild?.firstChild?.firstChild?.childNodes[1], |
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.
const { container } = render(<HomePageContent />); | ||
|
||
it("renders correctly", () => { | ||
expect(container.firstChild).toHaveClass("flex-1"); |
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.
Please perform more meaningful assertions that's obvious to the user experience other than merely asserting this flex-1
class.
Closes #598
Description
Remove "last updated" alert from homepage
Current Tasks