This commit is contained in:
Presley Pizzo
2022-10-19 03:41:53 +00:00
parent 950ac50193
commit 296281d99f
3 changed files with 6 additions and 6 deletions
@@ -124,7 +124,7 @@ export const PaginationWidget = ({
const firstPageActive = activePage === 1 && numPages !== 0
const lastPageActive = activePage === numPages && numPages !== 0
const theme = useTheme()
const isMobile = useMediaQuery(theme.breakpoints.down('sm'))
const isMobile = useMediaQuery(theme.breakpoints.down("sm"))
const styles = useStyles()
// No need to display any pagination if we know the number of pages is 1
@@ -145,9 +145,7 @@ export const PaginationWidget = ({
</Button>
<Maybe condition={numPages > 0}>
<ChooseOne>
<Cond
condition={isMobile}
>
<Cond condition={isMobile}>
<PageButton
activePage={activePage}
page={activePage}
@@ -47,7 +47,9 @@ describe("WorkspacesPage", () => {
const nextPage = await screen.findByRole("button", { name: "Next page" })
expect(nextPage).toBeEnabled()
await user.click(nextPage)
const pageButtons = await container.querySelectorAll(`button[name="Page button"]`)
const pageButtons = await container.querySelectorAll(
`button[name="Page button"]`,
)
expect(pageButtons.length).toBe(2)
})
})
+1 -1
View File
@@ -507,7 +507,7 @@ export const MockWorkspaceRequest: TypesGen.CreateWorkspaceRequest = {
}
export const MockWorkspaceCountResponse: TypesGen.WorkspaceCountResponse = {
count: 26 // just over 1 page
count: 26, // just over 1 page
}
export const MockUserAgent: Types.UserAgent = {