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 @@ -71,7 +71,23 @@ function RootComponent() {
7171 } }
7272 >
7373 This Route Does Not Exist
74- </ Link >
74+ </ Link > { ' ' }
75+ < div class = "flex items-center" >
76+ < svg width = "20" height = "20" viewBox = "0 0 20 20" role = "img" >
77+ < title id = "rectTitle" > Link in SVG</ title >
78+ < Link to = "/posts" aria-label = "Open posts from SVG" >
79+ < rect
80+ x = "0"
81+ y = "0"
82+ width = "20"
83+ height = "20"
84+ rx = "4"
85+ fill = "blue"
86+ stroke-width = "2"
87+ />
88+ </ Link >
89+ </ svg >
90+ </ div >
7591 </ div >
7692 < Outlet />
7793 < 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