File tree 1 file changed +11
-0
lines changed
site/src/pages/WorkspacesPage 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 1
1
import { screen } from "@testing-library/react"
2
+ import userEvent from "@testing-library/user-event"
2
3
import { rest } from "msw"
3
4
import * as CreateDayString from "util/createDayString"
4
5
import { Language as WorkspacesTableBodyLanguage } from "../../components/WorkspacesTable/WorkspacesTableBody"
@@ -39,4 +40,14 @@ describe("WorkspacesPage", () => {
39
40
// Then
40
41
await screen . findByText ( MockWorkspace . name )
41
42
} )
43
+
44
+ it ( "navigates to the next page of workspaces" , async ( ) => {
45
+ const user = userEvent . setup ( )
46
+ const { container } = render ( < WorkspacesPage /> )
47
+ const nextPage = await screen . findByRole ( "button" , { name : "Next page" } )
48
+ expect ( nextPage ) . toBeEnabled ( )
49
+ await user . click ( nextPage )
50
+ const pageButtons = await container . querySelectorAll ( `button[name="Page button"]` )
51
+ expect ( pageButtons . length ) . toBe ( 2 )
52
+ } )
42
53
} )
You can’t perform that action at this time.
0 commit comments