File tree Expand file tree Collapse file tree 2 files changed +13
-14
lines changed
packages/nextjs/test/integration Expand file tree Collapse file tree 2 files changed +13
-14
lines changed Original file line number Diff line number Diff line change 1- const ButtonPage = ( ) : JSX . Element => (
2- < button
3- onClick = { ( ) => {
4- // test that a span is created in the pageload transaction for this fetch request
5- fetch ( 'http://example.com' ) . catch ( ( ) => {
6- // no-empty
7- } ) ;
8- } }
9- >
10- Send Request
11- </ button >
12- ) ;
1+ import { useEffect } from 'react' ;
132
14- export default ButtonPage ;
3+ const FetchPage = ( ) : JSX . Element => {
4+ useEffect ( ( ) => {
5+ // test that a span is created in the pageload transaction for this fetch request
6+ fetch ( 'http://example.com' ) . catch ( ( ) => {
7+ // no-empty
8+ } ) ;
9+ } , [ ] ) ;
10+
11+ return < p > Hello world!</ p > ;
12+ } ;
13+
14+ export default FetchPage ;
Original file line number Diff line number Diff line change 88module . exports = async ( { page, url, requests } ) => {
99 const requestPromise = page . waitForRequest ( isTransactionRequest ) ;
1010 await page . goto ( `${ url } /fetch` ) ;
11- await page . click ( 'button' ) ;
1211 await requestPromise ;
1312
1413 expectTransaction ( requests . transactions [ 0 ] , {
You can’t perform that action at this time.
0 commit comments