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' ;
13
2
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 8
8
module . exports = async ( { page, url, requests } ) => {
9
9
const requestPromise = page . waitForRequest ( isTransactionRequest ) ;
10
10
await page . goto ( `${ url } /fetch` ) ;
11
- await page . click ( 'button' ) ;
12
11
await requestPromise ;
13
12
14
13
expectTransaction ( requests . transactions [ 0 ] , {
You can’t perform that action at this time.
0 commit comments