mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
Fix cancel tests
This commit is contained in:
@@ -75,14 +75,16 @@ describe("Create User Page", () => {
|
||||
expect(successMessage).toBeDefined()
|
||||
expect(history.location.pathname).toEqual("/users")
|
||||
})
|
||||
it("redirects to users page on cancel", () => {
|
||||
it("redirects to users page on cancel", async () => {
|
||||
render(<CreateUserPage />)
|
||||
screen.findByText(FooterLanguage.cancelLabel)
|
||||
const cancelButton = await screen.findByText(FooterLanguage.cancelLabel)
|
||||
act(() => cancelButton.click())
|
||||
expect(history.location.pathname).toEqual("/users")
|
||||
})
|
||||
it("redirects to users page on close", () => {
|
||||
it("redirects to users page on close", async () => {
|
||||
render(<CreateUserPage />)
|
||||
screen.findByText("ESC")
|
||||
const closeButton = await screen.findByText("ESC")
|
||||
act(() => closeButton.click())
|
||||
expect(history.location.pathname).toEqual("/users")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user