File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
examples/expo-app/__tests__ Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -15,14 +15,22 @@ describe('Index', () => {
15
15
// Wait for the subscription status to be updated
16
16
await waitFor (
17
17
( ) => {
18
- expect ( getByTestId ( 'realtime_status' ) ) . toHaveTextContent ( 'SUBSCRIBED' )
18
+ const status = getByTestId ( 'realtime_status' ) . props . children
19
+ expect ( status ) . toBe ( 'SUBSCRIBED' )
19
20
} ,
20
21
{
21
- timeout : 10000 ,
22
+ timeout : 30000 , // 30 seconds timeout for waitFor
23
+ interval : 1000 , // Check every second
24
+ onTimeout : ( error ) => {
25
+ const currentStatus = getByTestId ( 'realtime_status' ) . props . children
26
+ throw new Error (
27
+ `Timeout waiting for SUBSCRIBED status. Current status: ${ currentStatus } . ${ error . message } `
28
+ )
29
+ } ,
22
30
}
23
31
)
24
32
25
33
// Unmount the component to trigger cleanup.
26
34
unmount ( )
27
- } , 10000 )
35
+ } , 35000 ) // 35 seconds timeout for the entire test
28
36
} )
You can’t perform that action at this time.
0 commit comments