@@ -154,7 +154,7 @@ if (!isBuild) {
154
154
} )
155
155
156
156
test ( 'invalidate' , async ( ) => {
157
- const el = await page . $ ( '.invalidation' )
157
+ const el = await page . $ ( '.invalidation-parent ' )
158
158
await untilBrowserLogAfter (
159
159
( ) =>
160
160
editFile ( 'invalidation/child.js' , ( code ) =>
@@ -182,7 +182,7 @@ if (!isBuild) {
182
182
page2 = await browser . newPage ( )
183
183
await page2 . goto ( viteTestUrl )
184
184
185
- const el = await page . $ ( '.invalidation' )
185
+ const el = await page . $ ( '.invalidation-parent ' )
186
186
await untilBrowserLogAfter (
187
187
( ) =>
188
188
editFile ( 'invalidation/child.js' , ( code ) =>
@@ -208,6 +208,15 @@ if (!isBuild) {
208
208
}
209
209
} )
210
210
211
+ test ( 'invalidate on root triggers page reload' , async ( ) => {
212
+ editFile ( 'invalidation/root.js' , ( code ) => code . replace ( 'Init' , 'Updated' ) )
213
+ await page . waitForEvent ( 'load' )
214
+ await untilUpdated (
215
+ async ( ) => ( await page . $ ( '.invalidation-root' ) ) . textContent ( ) ,
216
+ 'Updated' ,
217
+ )
218
+ } )
219
+
211
220
test ( 'soft invalidate' , async ( ) => {
212
221
const el = await page . $ ( '.soft-invalidation' )
213
222
expect ( await el . textContent ( ) ) . toBe (
0 commit comments