@@ -341,6 +341,49 @@ test.describe('router-client', () => {
341341 await expect ( page . getByTestId ( 'route-query' ) ) . toHaveText ( 'x=1' ) ;
342342 } ) ;
343343
344+ test ( 'skip header omits static layout payload on soft navigation' , async ( {
345+ page,
346+ } ) => {
347+ await page . goto ( `http://localhost:${ port } /skip/a` ) ;
348+ await waitForHydration ( page ) ;
349+
350+ await expect ( page . getByTestId ( 'skip-static-layout-marker' ) ) . toHaveText (
351+ 'SKIP_STATIC_LAYOUT_MARKER' ,
352+ ) ;
353+ await expect (
354+ page . getByRole ( 'heading' , { name : 'SKIP_A_PAGE_MARKER' } ) ,
355+ ) . toBeVisible ( ) ;
356+
357+ const rscResponsePromise = page . waitForResponse (
358+ ( response ) =>
359+ response . url ( ) . includes ( '/RSC/R/skip/b.txt' ) &&
360+ response . request ( ) . method ( ) === 'GET' ,
361+ ) ;
362+
363+ await page . getByTestId ( 'skip-go-b' ) . click ( ) ;
364+
365+ const response = await rscResponsePromise ;
366+ const request = response . request ( ) ;
367+ const skipHeader = request . headers ( ) [ 'x-waku-router-skip' ] ;
368+
369+ expect ( skipHeader ) . toBeTruthy ( ) ;
370+ const skipIds = JSON . parse ( skipHeader as string ) as unknown ;
371+ expect ( Array . isArray ( skipIds ) ) . toBe ( true ) ;
372+ expect ( skipIds ) . toContain ( 'root' ) ;
373+
374+ const payload = await response . text ( ) ;
375+ expect ( payload ) . toContain ( 'SKIP_B_PAGE_MARKER' ) ;
376+ expect ( payload ) . not . toContain ( 'SKIP_STATIC_LAYOUT_MARKER' ) ;
377+ expect ( payload ) . not . toContain ( 'SKIP_A_PAGE_MARKER' ) ;
378+
379+ await expect (
380+ page . getByRole ( 'heading' , { name : 'SKIP_B_PAGE_MARKER' } ) ,
381+ ) . toBeVisible ( ) ;
382+ await expect ( page . getByTestId ( 'skip-static-layout-marker' ) ) . toHaveText (
383+ 'SKIP_STATIC_LAYOUT_MARKER' ,
384+ ) ;
385+ } ) ;
386+
344387 test ( 'unstable_prefetchOnView triggers prefetch when link enters viewport' , async ( {
345388 page,
346389 } ) => {
@@ -459,7 +502,7 @@ test.describe('router-client', () => {
459502 page . getByRole ( 'heading' , { name : 'Custom 404' } ) ,
460503 ) . toBeVisible ( ) ;
461504 await expect ( page . getByTestId ( 'route-path' ) ) . toHaveText ( '/404' ) ;
462- await expect ( page ) . toHaveURL ( / \/ s t a r t $ / ) ;
505+ await expect ( page ) . toHaveURL ( / \/ m i s s i n g $ / ) ;
463506 consoleErrors = dropExpectedErrorFlowConsoleErrors ( consoleErrors ) ;
464507 } ) ;
465508} ) ;
0 commit comments