File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed
site/src/pages/UsersPage/CreateUserPage Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -75,14 +75,16 @@ describe("Create User Page", () => {
75
75
expect ( successMessage ) . toBeDefined ( )
76
76
expect ( history . location . pathname ) . toEqual ( "/users" )
77
77
} )
78
- it ( "redirects to users page on cancel" , ( ) => {
78
+ it ( "redirects to users page on cancel" , async ( ) => {
79
79
render ( < CreateUserPage /> )
80
- screen . findByText ( FooterLanguage . cancelLabel )
80
+ const cancelButton = await screen . findByText ( FooterLanguage . cancelLabel )
81
+ act ( ( ) => cancelButton . click ( ) )
81
82
expect ( history . location . pathname ) . toEqual ( "/users" )
82
83
} )
83
- it ( "redirects to users page on close" , ( ) => {
84
+ it ( "redirects to users page on close" , async ( ) => {
84
85
render ( < CreateUserPage /> )
85
- screen . findByText ( "ESC" )
86
+ const closeButton = await screen . findByText ( "ESC" )
87
+ act ( ( ) => closeButton . click ( ) )
86
88
expect ( history . location . pathname ) . toEqual ( "/users" )
87
89
} )
88
90
} )
You can’t perform that action at this time.
0 commit comments