Skip to content

Commit 94f4ae9

Browse files
author
Luca Forstner
authored
test(nextjs): Make tracingFetch integration test not use UI elements (#6283)
1 parent 9f522c9 commit 94f4ae9

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed
Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
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;

packages/nextjs/test/integration/test/client/tracingFetch.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ const {
88
module.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], {

0 commit comments

Comments
 (0)