File tree 2 files changed +6
-6
lines changed
2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -63,17 +63,17 @@ if (!isBuild) {
63
63
'<div id="hmr-test">foo</div>\n<!-- HMR-TEMPLATE-INJECT -->'
64
64
)
65
65
) ;
66
- expect ( await getText ( `#hmr-test` ) ) . toBe ( ' foo') ;
66
+ await untilMatches ( ( ) => getText ( `#hmr-test` ) , 'foo' , '#hmr-test contains text foo') ;
67
67
} ) ;
68
68
test ( 'should apply style update' , async ( ) => {
69
69
expect ( await getColor ( `h1` ) ) . toBe ( 'green' ) ;
70
70
await updateApp ( ( content ) => content . replace ( 'color: green' , 'color: red' ) ) ;
71
- expect ( await getColor ( `h1` ) ) . toBe ( ' red') ;
71
+ await untilMatches ( ( ) => getColor ( 'h1' ) , 'red' , 'h1 has color red') ;
72
72
} ) ;
73
73
test ( 'should not preserve state of updated props' , async ( ) => {
74
74
expect ( await getText ( `#foo` ) ) . toBe ( 'foo' ) ;
75
75
await updateApp ( ( content ) => content . replace ( "foo = 'foo'" , "foo = 'bar'" ) ) ;
76
- expect ( await getText ( `#foo` ) ) . toBe ( ' bar') ;
76
+ await untilMatches ( ( ) => getText ( `#foo` ) , 'bar' , '#foo contains text bar') ;
77
77
} ) ;
78
78
} ) ;
79
79
}
Original file line number Diff line number Diff line change @@ -59,17 +59,17 @@ if (!isBuild) {
59
59
'<div id="hmr-test">foo</div>\n<!-- HMR-TEMPLATE-INJECT -->'
60
60
)
61
61
) ;
62
- expect ( await getText ( `#hmr-test` ) ) . toBe ( ' foo') ;
62
+ await untilMatches ( ( ) => getText ( `#hmr-test` ) , 'foo' , '#hmr-test contains text foo') ;
63
63
} ) ;
64
64
test ( 'should apply style update' , async ( ) => {
65
65
expect ( await getColor ( `h1` ) ) . toBe ( 'green' ) ;
66
66
await updateApp ( ( content ) => content . replace ( 'color: green' , 'color: red' ) ) ;
67
- expect ( await getColor ( `h1` ) ) . toBe ( ' red') ;
67
+ await untilMatches ( ( ) => getColor ( 'h1' ) , 'red' , 'h1 has color red') ;
68
68
} ) ;
69
69
test ( 'should not preserve state of updated props' , async ( ) => {
70
70
expect ( await getText ( `#foo` ) ) . toBe ( 'foo' ) ;
71
71
await updateApp ( ( content ) => content . replace ( "foo = 'foo'" , "foo = 'bar'" ) ) ;
72
- expect ( await getText ( `#foo` ) ) . toBe ( ' bar') ;
72
+ await untilMatches ( ( ) => getText ( `#foo` ) , 'bar' , '#foo contains text bar') ;
73
73
} ) ;
74
74
} ) ;
75
75
}
You can’t perform that action at this time.
0 commit comments