File tree Expand file tree Collapse file tree 4 files changed +7
-33
lines changed Expand file tree Collapse file tree 4 files changed +7
-33
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -39,6 +39,8 @@ test('should not view protected resource if user role does not match and show fa
39
39
{ user } ,
40
40
) ;
41
41
42
+ await screen . findByText ( forbiddenMessage ) ;
43
+
42
44
expect ( screen . queryByText ( protectedResource ) ) . not . toBeInTheDocument ( ) ;
43
45
44
46
expect ( screen . getByText ( forbiddenMessage ) ) . toBeInTheDocument ( ) ;
Original file line number Diff line number Diff line change @@ -18,7 +18,10 @@ export const HomePage = () => {
18
18
19
19
return (
20
20
< >
21
- < Head description = "Welcome to bulletproof react" />
21
+ < Head
22
+ title = { 'Bulletproof React' }
23
+ description = "Welcome to bulletproof react"
24
+ />
22
25
< div className = "flex h-screen items-center bg-white" >
23
26
< div className = "mx-auto max-w-7xl px-4 py-12 text-center sm:px-6 lg:px-8 lg:py-16" >
24
27
< h2 className = "text-3xl font-extrabold tracking-tight text-gray-900 sm:text-4xl" >
Original file line number Diff line number Diff line change 1
- import {
2
- render as rtlRender ,
3
- screen ,
4
- waitForElementToBeRemoved ,
5
- } from '@testing-library/react' ;
1
+ import { render as rtlRender } from '@testing-library/react' ;
6
2
import userEvent from '@testing-library/user-event' ;
7
3
import Cookies from 'js-cookie' ;
8
4
@@ -33,15 +29,6 @@ export const loginAsUser = async (user: any) => {
33
29
return authUser ;
34
30
} ;
35
31
36
- export const waitForLoadingToFinish = ( ) =>
37
- waitForElementToBeRemoved (
38
- ( ) => [
39
- ...screen . queryAllByTestId ( / l o a d i n g / i) ,
40
- ...screen . queryAllByText ( / l o a d i n g / i) ,
41
- ] ,
42
- { timeout : 4000 } ,
43
- ) ;
44
-
45
32
const initializeUser = async ( user : any ) => {
46
33
if ( typeof user === 'undefined' ) {
47
34
const newUser = await createUser ( ) ;
@@ -68,8 +55,6 @@ export const renderApp = async (
68
55
user : initializedUser ,
69
56
} ;
70
57
71
- await waitForLoadingToFinish ( ) ;
72
-
73
58
return returnValue ;
74
59
} ;
75
60
You can’t perform that action at this time.
0 commit comments