This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -47,20 +47,20 @@ describe("useLatestResult", () => {
47
47
await act ( async ( ) => {
48
48
await sleep ( 25 ) ;
49
49
} ) ;
50
- expect ( wrapper . text ( ) ) . toContain ( "0" ) ;
50
+ expect ( wrapper . text ( ) ) . toEqual ( "0" ) ;
51
51
wrapper . setProps ( { doRequest, query : 1 } ) ;
52
52
await act ( async ( ) => {
53
- await sleep ( 15 ) ;
53
+ await sleep ( 10 ) ;
54
54
} ) ;
55
55
wrapper . setProps ( { doRequest, query : 2 } ) ;
56
56
await act ( async ( ) => {
57
- await sleep ( 15 ) ;
57
+ await sleep ( 10 ) ;
58
58
} ) ;
59
- expect ( wrapper . text ( ) ) . toContain ( "0" ) ;
59
+ expect ( wrapper . text ( ) ) . toEqual ( "0" ) ;
60
60
await act ( async ( ) => {
61
61
await sleep ( 15 ) ;
62
62
} ) ;
63
- expect ( wrapper . text ( ) ) . toContain ( "2" ) ;
63
+ expect ( wrapper . text ( ) ) . toEqual ( "2" ) ;
64
64
} ) ;
65
65
66
66
it ( "should prevent out-of-order results" , async ( ) => {
@@ -73,7 +73,7 @@ describe("useLatestResult", () => {
73
73
await act ( async ( ) => {
74
74
await sleep ( 5 ) ;
75
75
} ) ;
76
- expect ( wrapper . text ( ) ) . toContain ( "0" ) ;
76
+ expect ( wrapper . text ( ) ) . toEqual ( "0" ) ;
77
77
wrapper . setProps ( { doRequest, query : 50 } ) ;
78
78
await act ( async ( ) => {
79
79
await sleep ( 5 ) ;
@@ -82,10 +82,10 @@ describe("useLatestResult", () => {
82
82
await act ( async ( ) => {
83
83
await sleep ( 5 ) ;
84
84
} ) ;
85
- expect ( wrapper . text ( ) ) . toContain ( "1" ) ;
85
+ expect ( wrapper . text ( ) ) . toEqual ( "1" ) ;
86
86
await act ( async ( ) => {
87
87
await sleep ( 50 ) ;
88
88
} ) ;
89
- expect ( wrapper . text ( ) ) . toContain ( "1" ) ;
89
+ expect ( wrapper . text ( ) ) . toEqual ( "1" ) ;
90
90
} ) ;
91
91
} ) ;
You can’t perform that action at this time.
0 commit comments