File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed 
dev-packages/e2e-tests/test-applications/nextjs-15 Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change 1+ import  Link  from  'next/link' ; 
2+ 
3+ export  default  function  Page ( )  { 
4+   return  ( 
5+     < Link  prefetch  id = "prefetch-link"  href = "/prefetching/to-be-prefetched" > 
6+       link
7+     </ Link > 
8+   ) ; 
9+ } 
Original file line number Diff line number Diff line change 1+ export  default  function  Page ( )  { 
2+   return  < p > Hello</ p > ; 
3+ } 
Original file line number Diff line number Diff line change 1+ import  {  expect ,  test  }  from  '@playwright/test' ; 
2+ import  {  waitForTransaction  }  from  '@sentry-internal/test-utils' ; 
3+ 
4+ test ( 'Prefetch client spans should have the right op' ,  async  ( {  page } )  =>  { 
5+   const  pageloadTransactionPromise  =  waitForTransaction ( 'nextjs-15' ,  async  transactionEvent  =>  { 
6+     return  transactionEvent ?. transaction  ===  '/prefetching' ; 
7+   } ) ; 
8+ 
9+   await  page . goto ( `/prefetching` ) ; 
10+ 
11+   // Make it more likely that nextjs prefetches 
12+   await  page . hover ( '#prefetch-link' ) ; 
13+ 
14+   expect ( ( await  pageloadTransactionPromise ) . spans ) . toContainEqual ( 
15+     expect . objectContaining ( { 
16+       op : 'http.client.prefetch' , 
17+     } ) , 
18+   ) ; 
19+ } ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments