@@ -637,6 +637,61 @@ test.describe("SPA Mode", () => {
637
637
expect ( html . match ( / w i n d o w ._ _ r e a c t R o u t e r C o n t e x t = / g) ?. length ) . toBe ( 1 ) ;
638
638
expect ( html . match ( / 💿 H e y d e v e l o p e r 👋 / g) ?. length ) . toBe ( 1 ) ;
639
639
} ) ;
640
+
641
+ test ( "does not inherit single fetch revalidation behavior" , async ( {
642
+ page,
643
+ } ) => {
644
+ fixture = await createFixture ( {
645
+ spaMode : true ,
646
+ files : {
647
+ "react-router.config.ts" : reactRouterConfig ( {
648
+ ssr : false ,
649
+ splitRouteModules,
650
+ } ) ,
651
+ "app/routes/_index.tsx" : js `
652
+ import { Link } from 'react-router';
653
+ export default function Component() {
654
+ return <Link to="/parent">Go to parent</Link>;
655
+ }
656
+ ` ,
657
+ "app/routes/parent.tsx" : js `
658
+ import { Link, Outlet } from 'react-router';
659
+ let count = 0;
660
+ export function clientLoader() {
661
+ return ++count;
662
+ }
663
+ export default function Component({ loaderData }) {
664
+ return (
665
+ <>
666
+ <h1>Parent: {loaderData}</h1>
667
+ <Link to="./child">Go to child</Link>
668
+ <Outlet />
669
+ </>
670
+ )
671
+ }
672
+ ` ,
673
+ "app/routes/parent.child.tsx" : js `
674
+ import { Link } from 'react-router';
675
+ export default function Component({ loaderData }) {
676
+ return <h2>Child</h2>;
677
+ }
678
+ ` ,
679
+ } ,
680
+ } ) ;
681
+ appFixture = await createAppFixture ( fixture ) ;
682
+
683
+ let app = new PlaywrightFixture ( appFixture , page ) ;
684
+ await app . goto ( "/" , true ) ;
685
+ await page . waitForSelector ( 'a[href="/parent"]' ) ;
686
+ await app . clickLink ( "/parent" ) ;
687
+ await page . waitForSelector ( "h1" ) ;
688
+ expect ( await page . locator ( "h1" ) . textContent ( ) ) . toBe ( "Parent: 1" ) ;
689
+
690
+ await app . clickLink ( "/parent/child" ) ;
691
+ await page . waitForSelector ( "h2" ) ;
692
+ expect ( await page . locator ( "h1" ) . textContent ( ) ) . toBe ( "Parent: 1" ) ;
693
+ expect ( await page . locator ( "h2" ) . textContent ( ) ) . toBe ( "Child" ) ;
694
+ } ) ;
640
695
} ) ;
641
696
642
697
test . describe ( "normal apps" , ( ) => {
0 commit comments