@@ -321,19 +321,25 @@ describe('pagesRouterInstrumentNavigation', () => {
321321
322322 Router . events . emit ( 'routeChangeStart' , targetLocation ) ;
323323
324- expect ( emit ) . toHaveBeenCalledTimes ( 1 ) ;
324+ expect ( emit ) . toHaveBeenCalledTimes ( 2 ) ;
325+ const expectedStartSpanOptions = {
326+ name : expectedTransactionName ,
327+ attributes : {
328+ 'sentry.op' : 'navigation' ,
329+ 'sentry.origin' : 'auto.navigation.nextjs.pages_router_instrumentation' ,
330+ 'sentry.source' : expectedTransactionSource ,
331+ } ,
332+ } ;
325333 expect ( emit ) . toHaveBeenCalledWith (
326- 'startNavigationSpan' ,
327- expect . objectContaining ( {
328- name : expectedTransactionName ,
329- attributes : {
330- 'sentry.op' : 'navigation' ,
331- 'sentry.origin' : 'auto.navigation.nextjs.pages_router_instrumentation' ,
332- 'sentry.source' : expectedTransactionSource ,
333- } ,
334- } ) ,
335- { isRedirect : undefined } ,
334+ 'beforeStartNavigationSpan' ,
335+ expect . objectContaining ( expectedStartSpanOptions ) ,
336+ {
337+ isRedirect : undefined ,
338+ } ,
336339 ) ;
340+ expect ( emit ) . toHaveBeenCalledWith ( 'startNavigationSpan' , expect . objectContaining ( expectedStartSpanOptions ) , {
341+ isRedirect : undefined ,
342+ } ) ;
337343 } ,
338344 ) ;
339345} ) ;
0 commit comments