File tree Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Expand file tree Collapse file tree 2 files changed +34
-1
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,23 @@ function RootComponent() {
6969 } }
7070 >
7171 This Route Does Not Exist
72- </ Link >
72+ </ Link > { ' ' }
73+ < div className = "flex items-center" >
74+ < svg width = "20" height = "20" viewBox = "0 0 20 20" role = "img" >
75+ < title id = "rectTitle" > Link in SVG</ title >
76+ < Link to = "/posts" aria-label = "Open posts from SVG" >
77+ < rect
78+ x = "0"
79+ y = "0"
80+ width = "20"
81+ height = "20"
82+ rx = "4"
83+ fill = "blue"
84+ strokeWidth = "2"
85+ />
86+ </ Link >
87+ </ svg >
88+ </ div >
7389 </ div >
7490 < Outlet />
7591 < TanStackRouterDevtools position = "bottom-right" />
Original file line number Diff line number Diff line change 11import { expect , test } from '@playwright/test'
2+ import { getTestServerPort } from '@tanstack/router-e2e-utils'
3+ import packageJson from '../package.json' with { type : 'json' }
4+
5+ const PORT = await getTestServerPort ( packageJson . name )
26
37test . beforeEach ( async ( { page } ) => {
48 await page . goto ( '/' )
@@ -45,3 +49,16 @@ test('Navigating to a post page with viewTransition types', async ({
4549 await page . getByRole ( 'link' , { name : 'sunt aut facere repe' } ) . click ( )
4650 await expect ( page . getByRole ( 'heading' ) ) . toContainText ( 'sunt aut facere' )
4751} )
52+
53+ test ( 'Link in SVG does not trigger a full page reload' , async ( { page } ) => {
54+ let fullPageLoad = false
55+ page . on ( 'domcontentloaded' , ( ) => {
56+ fullPageLoad = true
57+ } )
58+
59+ await page . getByRole ( 'link' , { name : 'Open posts from SVG' } ) . click ( )
60+ const url = `http://localhost:${ PORT } /posts`
61+ await page . waitForURL ( url )
62+
63+ expect ( fullPageLoad ) . toBeFalsy ( )
64+ } )
You can’t perform that action at this time.
0 commit comments