Skip to content

Commit 693c5cf

Browse files
committed
Move client.tsx to index.
1 parent d9c2cf0 commit 693c5cf

File tree

3 files changed

+18
-89
lines changed

3 files changed

+18
-89
lines changed

packages/e2e-tests/test-applications/create-next-app/pages/client.tsx

Lines changed: 0 additions & 21 deletions
This file was deleted.

packages/e2e-tests/test-applications/create-next-app/pages/index.tsx

Lines changed: 15 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import Head from 'next/head';
2-
import Image from 'next/image';
3-
import { Inter } from '@next/font/google';
4-
5-
const inter = Inter({ subsets: ['latin'] });
2+
import Link from 'next/link';
3+
import * as Sentry from '@sentry/nextjs';
64

75
export default function Home() {
86
return (
@@ -11,69 +9,21 @@ export default function Home() {
119
<title>Create Next App</title>
1210
<meta name="description" content="Generated by create next app" />
1311
<meta name="viewport" content="width=device-width, initial-scale=1" />
12+
<link rel="icon" href="/favicon.ico" />
1413
</Head>
1514
<main>
16-
<div>
17-
<p>
18-
Get started by editing&nbsp;
19-
<code>pages/index.tsx</code>
20-
</p>
21-
<div>
22-
<a
23-
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
24-
target="_blank"
25-
rel="noopener noreferrer"
26-
>
27-
By{' '}
28-
</a>
29-
</div>
30-
</div>
31-
32-
<div>
33-
<a
34-
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
35-
target="_blank"
36-
rel="noopener noreferrer"
37-
>
38-
<h2>
39-
Docs <span>-&gt;</span>
40-
</h2>
41-
<p>Find in-depth information about Next.js features and&nbsp;API.</p>
42-
</a>
43-
44-
<a
45-
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
46-
target="_blank"
47-
rel="noopener noreferrer"
48-
>
49-
<h2>
50-
Learn <span>-&gt;</span>
51-
</h2>
52-
<p>Learn about Next.js in an interactive course with&nbsp;quizzes!</p>
53-
</a>
54-
55-
<a
56-
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
57-
target="_blank"
58-
rel="noopener noreferrer"
59-
>
60-
<h2>
61-
Templates <span>-&gt;</span>
62-
</h2>
63-
<p>Discover and deploy boilerplate example Next.js&nbsp;projects.</p>
64-
</a>
65-
66-
<a
67-
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
68-
target="_blank"
69-
rel="noopener noreferrer"
70-
>
71-
<h2>
72-
Deploy <span>-&gt;</span>
73-
</h2>
74-
<p>Instantly deploy your Next.js site to a shareable URL with&nbsp;Vercel.</p>
75-
</a>
76-
</div>
15+
<input
16+
type="button"
17+
value="Capture Exception"
18+
id="exception-button"
19+
onClick={() => {
20+
const eventId = Sentry.captureException(new Error('I am an error!'));
21+
window.capturedExceptionId = eventId;
22+
}}
23+
/>
24+
<Link href="/user/5" id="navigation">
25+
navigate
26+
</Link>
7727
</main>
7828
</>
7929
);

packages/e2e-tests/test-applications/create-next-app/tests/client/behaviour.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ const sentryTestProject = process.env.E2E_TEST_SENTRY_TEST_PROJECT;
77
const EVENT_POLLING_TIMEOUT = 30_000;
88

99
test('Sends an exception to Sentry', async ({ page, baseURL }) => {
10-
await page.goto('/client');
10+
await page.goto('/');
1111

1212
const exceptionButton = page.locator('id=exception-button');
1313
await exceptionButton.click();
@@ -47,7 +47,7 @@ test('Sends an exception to Sentry', async ({ page, baseURL }) => {
4747
});
4848

4949
test('Sends a pageload transaction to Sentry', async ({ page }) => {
50-
await page.goto('/client');
50+
await page.goto('/');
5151

5252
const recordedTransactionsHandle = await page.waitForFunction(() => {
5353
if (window.recordedTransactions && window.recordedTransactions?.length >= 1) {
@@ -106,7 +106,7 @@ test('Sends a pageload transaction to Sentry', async ({ page }) => {
106106
});
107107

108108
test('Sends a navigation transaction to Sentry', async ({ page }) => {
109-
await page.goto('/client');
109+
await page.goto('/');
110110

111111
// Give pageload transaction time to finish
112112
await page.waitForTimeout(4000);

0 commit comments

Comments
 (0)