File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed
packages/sveltekit/test/client Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -123,4 +123,18 @@ describe('sveltekitRoutingInstrumentation', () => {
123
123
124
124
expect ( routingSpanFinishSpy ) . toHaveBeenCalledTimes ( 1 ) ;
125
125
} ) ;
126
+
127
+ it ( "doesn't start a navigation transaction if navigation origin and destination are equal" , ( ) => {
128
+ svelteKitRoutingInstrumentation ( mockedStartTransaction , false , true ) ;
129
+
130
+ // We emit an update to the `navigating` store to simulate the SvelteKit navigation lifecycle
131
+ // @ts -ignore This is fine because we testUtils/stores.ts defines `navigating` as a writable store
132
+ navigating . set ( {
133
+ from : { route : { id : 'testRoute' } } ,
134
+ to : { route : { id : 'testRoute' } } ,
135
+ } ) ;
136
+
137
+ // This should update the transaction name with the parameterized route:
138
+ expect ( mockedStartTransaction ) . toHaveBeenCalledTimes ( 0 ) ;
139
+ } ) ;
126
140
} ) ;
You can’t perform that action at this time.
0 commit comments