-
Notifications
You must be signed in to change notification settings - Fork 0
[Issue #174] Hide pagination component if no results are found #175
Conversation
@btabaska , great catch! |
Coverage report for
|
St.❔ |
Category | Percentage | Covered / Total |
---|---|---|---|
🟢 | Statements | 90.06% | 707/785 |
🟡 | Branches | 71.33% (+0.1% 🔼) |
204/286 |
🟢 | Functions | 86.31% | 145/168 |
🟢 | Lines | 90.75% | 667/735 |
Test suite run success
155 tests passing in 47 suites.
Report generated by 🧪jest coverage report action from d06a241
// PaginationPosition, | ||
// } from "../../../src/components/search/SearchPagination"; | ||
|
||
// import { render } from "@testing-library/react"; |
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.
👏🏿
*for removing commented out code
@@ -35,24 +35,28 @@ export default function SearchPagination({ | |||
const pages = total || Number(totalPages); | |||
|
|||
const updatePage = (page: number) => { | |||
console.log("here"); |
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 like this got left here:
console.log("here"); |
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.
Great catch. This should have been caught by linting. Filing a ticket to add no-console-statement to Eslint config
updateTotalPages(String(total)); | ||
updateTotalResults(totalResults); | ||
updateQueryParams(String(page), "page", query, scroll); | ||
console.log("here2"); |
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.
This one too
console.log("here2"); |
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.
Great catch, created. #181 to add no-console to eslint
@btabaska I found that if I click on the pager first, it doesn't disappear. Maybe if the page it is zero it should check and remove existing pagers, or we could just ignore this as it is not likely to happen often. Screenshare.-.2024-08-26.5_23_14.PM.mp4 |
) Fixes HHS#2040 > Updated pagination component to hide if there are no results. Previously it would show 7 pages that you could navigate between, all with no results. Updated all unit tests for pagination component. They were broken and commented out previously. ![2024-08-08 15 45 10](https://github.com/user-attachments/assets/27e8dc6a-dddd-4c52-8086-4cd4579d73fe)
) Fixes HHS#2040 > Updated pagination component to hide if there are no results. Previously it would show 7 pages that you could navigate between, all with no results. Updated all unit tests for pagination component. They were broken and commented out previously. ![2024-08-08 15 45 10](https://github.com/user-attachments/assets/27e8dc6a-dddd-4c52-8086-4cd4579d73fe)
…pbc#175) Fixes #2040 > Updated pagination component to hide if there are no results. Previously it would show 7 pages that you could navigate between, all with no results. Updated all unit tests for pagination component. They were broken and commented out previously. ![2024-08-08 15 45 10](https://github.com/user-attachments/assets/27e8dc6a-dddd-4c52-8086-4cd4579d73fe)
Summary
Fixes #174
Time to review: 8 mins
Changes proposed
Context for reviewers
Updated all unit tests for pagination component. They were broken and commented out previously.
Additional information