@@ -154,7 +154,7 @@ if (!isBuild) {
154154  } ) 
155155
156156  test ( 'invalidate' ,  async  ( )  =>  { 
157-     const  el  =  await  page . $ ( '.invalidation' ) 
157+     const  el  =  await  page . $ ( '.invalidation-parent ' ) 
158158    await  untilBrowserLogAfter ( 
159159      ( )  => 
160160        editFile ( 'invalidation/child.js' ,  ( code )  => 
@@ -182,7 +182,7 @@ if (!isBuild) {
182182      page2  =  await  browser . newPage ( ) 
183183      await  page2 . goto ( viteTestUrl ) 
184184
185-       const  el  =  await  page . $ ( '.invalidation' ) 
185+       const  el  =  await  page . $ ( '.invalidation-parent ' ) 
186186      await  untilBrowserLogAfter ( 
187187        ( )  => 
188188          editFile ( 'invalidation/child.js' ,  ( code )  => 
@@ -208,6 +208,15 @@ if (!isBuild) {
208208    } 
209209  } ) 
210210
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+ 
211220  test ( 'soft invalidate' ,  async  ( )  =>  { 
212221    const  el  =  await  page . $ ( '.soft-invalidation' ) 
213222    expect ( await  el . textContent ( ) ) . toBe ( 
0 commit comments