Skip to content

Commit f611aa4

Browse files
committed
adjust solidstart tests
1 parent ba1c692 commit f611aa4

File tree

6 files changed

+48
-18
lines changed

6 files changed

+48
-18
lines changed

dev-packages/e2e-tests/test-applications/solidstart-dynamic-import/tests/errorboundary.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test('captures an exception', async ({ page }) => {
2323
type: 'Error',
2424
value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app',
2525
mechanism: {
26-
type: 'generic',
26+
type: 'auto.function.solid.error_boundary',
2727
handled: true,
2828
},
2929
},
@@ -53,7 +53,7 @@ test('captures a second exception after resetting the boundary', async ({ page }
5353
type: 'Error',
5454
value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app',
5555
mechanism: {
56-
type: 'generic',
56+
type: 'auto.function.solid.error_boundary',
5757
handled: true,
5858
},
5959
},
@@ -81,7 +81,7 @@ test('captures a second exception after resetting the boundary', async ({ page }
8181
type: 'Error',
8282
value: 'Error 2 thrown from Sentry ErrorBoundary in Solid Start E2E test app',
8383
mechanism: {
84-
type: 'generic',
84+
type: 'auto.function.solid.error_boundary',
8585
handled: true,
8686
},
8787
},

dev-packages/e2e-tests/test-applications/solidstart-spa/tests/errorboundary.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test('captures an exception', async ({ page }) => {
2121
type: 'Error',
2222
value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app',
2323
mechanism: {
24-
type: 'generic',
24+
type: 'auto.function.solid.error_boundary',
2525
handled: true,
2626
},
2727
},
@@ -51,7 +51,7 @@ test('captures a second exception after resetting the boundary', async ({ page }
5151
type: 'Error',
5252
value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app',
5353
mechanism: {
54-
type: 'generic',
54+
type: 'auto.function.solid.error_boundary',
5555
handled: true,
5656
},
5757
},
@@ -79,7 +79,7 @@ test('captures a second exception after resetting the boundary', async ({ page }
7979
type: 'Error',
8080
value: 'Error 2 thrown from Sentry ErrorBoundary in Solid Start E2E test app',
8181
mechanism: {
82-
type: 'generic',
82+
type: 'auto.function.solid.error_boundary',
8383
handled: true,
8484
},
8585
},

dev-packages/e2e-tests/test-applications/solidstart-top-level-import/tests/errorboundary.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test('captures an exception', async ({ page }) => {
2121
type: 'Error',
2222
value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app',
2323
mechanism: {
24-
type: 'generic',
24+
type: 'auto.function.solid.error_boundary',
2525
handled: true,
2626
},
2727
},
@@ -51,7 +51,7 @@ test('captures a second exception after resetting the boundary', async ({ page }
5151
type: 'Error',
5252
value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app',
5353
mechanism: {
54-
type: 'generic',
54+
type: 'auto.function.solid.error_boundary',
5555
handled: true,
5656
},
5757
},
@@ -79,7 +79,7 @@ test('captures a second exception after resetting the boundary', async ({ page }
7979
type: 'Error',
8080
value: 'Error 2 thrown from Sentry ErrorBoundary in Solid Start E2E test app',
8181
mechanism: {
82-
type: 'generic',
82+
type: 'auto.function.solid.error_boundary',
8383
handled: true,
8484
},
8585
},

dev-packages/e2e-tests/test-applications/solidstart/tests/errorboundary.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ test('captures an exception', async ({ page }) => {
2121
type: 'Error',
2222
value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app',
2323
mechanism: {
24-
type: 'generic',
24+
type: 'auto.function.solid.error_boundary',
2525
handled: true,
2626
},
2727
},
@@ -51,7 +51,7 @@ test('captures a second exception after resetting the boundary', async ({ page }
5151
type: 'Error',
5252
value: 'Error 1 thrown from Sentry ErrorBoundary in Solid Start E2E test app',
5353
mechanism: {
54-
type: 'generic',
54+
type: 'auto.function.solid.error_boundary',
5555
handled: true,
5656
},
5757
},
@@ -79,7 +79,7 @@ test('captures a second exception after resetting the boundary', async ({ page }
7979
type: 'Error',
8080
value: 'Error 2 thrown from Sentry ErrorBoundary in Solid Start E2E test app',
8181
mechanism: {
82-
type: 'generic',
82+
type: 'auto.function.solid.error_boundary',
8383
handled: true,
8484
},
8585
},

packages/solidstart/test/client/errorboundary.test.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ describe('withSentryErrorBoundary', () => {
4949
));
5050

5151
expect(mockCaptureException).toHaveBeenCalledTimes(1);
52-
expect(mockCaptureException).toHaveBeenLastCalledWith(new ReferenceError('NonExistentComponent is not defined'));
52+
expect(mockCaptureException).toHaveBeenLastCalledWith(new ReferenceError('NonExistentComponent is not defined'), {
53+
mechanism: {
54+
handled: true,
55+
type: 'auto.function.solid.error_boundary',
56+
},
57+
});
5358
});
5459

5560
it('renders the fallback component', async () => {
@@ -89,13 +94,23 @@ describe('withSentryErrorBoundary', () => {
8994
));
9095

9196
expect(mockCaptureException).toHaveBeenCalledTimes(1);
92-
expect(mockCaptureException).toHaveBeenNthCalledWith(1, new ReferenceError('NonExistentComponent is not defined'));
97+
expect(mockCaptureException).toHaveBeenNthCalledWith(1, new ReferenceError('NonExistentComponent is not defined'), {
98+
mechanism: {
99+
handled: true,
100+
type: 'auto.function.solid.error_boundary',
101+
},
102+
});
93103

94104
const button = await findByRole('button');
95105
await user.click(button);
96106

97107
expect(mockCaptureException).toHaveBeenCalledTimes(2);
98-
expect(mockCaptureException).toHaveBeenNthCalledWith(2, new ReferenceError('NonExistentComponent is not defined'));
108+
expect(mockCaptureException).toHaveBeenNthCalledWith(2, new ReferenceError('NonExistentComponent is not defined'), {
109+
mechanism: {
110+
handled: true,
111+
type: 'auto.function.solid.error_boundary',
112+
},
113+
});
99114
});
100115

101116
it('renders children when there is no error', async () => {

packages/solidstart/test/server/errorboundary.test.tsx

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,12 @@ describe('withSentryErrorBoundary', () => {
4949
));
5050

5151
expect(mockCaptureException).toHaveBeenCalledTimes(1);
52-
expect(mockCaptureException).toHaveBeenLastCalledWith(new ReferenceError('NonExistentComponent is not defined'));
52+
expect(mockCaptureException).toHaveBeenLastCalledWith(new ReferenceError('NonExistentComponent is not defined'), {
53+
mechanism: {
54+
handled: true,
55+
type: 'auto.function.solid.error_boundary',
56+
},
57+
});
5358
});
5459

5560
it('renders the fallback component', async () => {
@@ -89,13 +94,23 @@ describe('withSentryErrorBoundary', () => {
8994
));
9095

9196
expect(mockCaptureException).toHaveBeenCalledTimes(1);
92-
expect(mockCaptureException).toHaveBeenNthCalledWith(1, new ReferenceError('NonExistentComponent is not defined'));
97+
expect(mockCaptureException).toHaveBeenNthCalledWith(1, new ReferenceError('NonExistentComponent is not defined'), {
98+
mechanism: {
99+
handled: true,
100+
type: 'auto.function.solid.error_boundary',
101+
},
102+
});
93103

94104
const button = await findByRole('button');
95105
await user.click(button);
96106

97107
expect(mockCaptureException).toHaveBeenCalledTimes(2);
98-
expect(mockCaptureException).toHaveBeenNthCalledWith(2, new ReferenceError('NonExistentComponent is not defined'));
108+
expect(mockCaptureException).toHaveBeenNthCalledWith(2, new ReferenceError('NonExistentComponent is not defined'), {
109+
mechanism: {
110+
handled: true,
111+
type: 'auto.function.solid.error_boundary',
112+
},
113+
});
99114
});
100115

101116
it('renders children when there is no error', async () => {

0 commit comments

Comments
 (0)