mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
Format
This commit is contained in:
@@ -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)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
Reference in New Issue
Block a user