Skip to content

Commit 17eb45a

Browse files
committed
Test error boundary rendering on v2 integration tests.
1 parent 75977b7 commit 17eb45a

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,7 @@ jobs:
10371037
'create-remix-app',
10381038
'create-remix-app-legacy',
10391039
'create-remix-app-v2',
1040+
'create-remix-app-v2-legacy',
10401041
'create-remix-app-express',
10411042
'create-remix-app-express-vite-dev',
10421043
'node-express-esm-loader',

packages/remix/test/integration/app_v2/root.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,11 @@ export const ErrorBoundary: V2_ErrorBoundaryComponent = () => {
88

99
captureRemixErrorBoundaryError(error);
1010

11-
return <div>error</div>;
11+
return (
12+
<div>
13+
<span id="error-header">ErrorBoundary Error</span>
14+
</div>
15+
);
1216
};
1317

1418
export const meta: V2_MetaFunction = ({ data }) => [

packages/remix/test/integration/test/client/errorboundary.test.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,4 +42,9 @@ test('should capture React component errors.', async ({ page }) => {
4242
expect(errorEnvelope.transaction).toBe(
4343
useV2 ? 'routes/error-boundary-capture.$id' : 'routes/error-boundary-capture/$id',
4444
);
45+
46+
if (useV2) {
47+
// The error boundary should be rendered
48+
expect(await page.textContent('#error-header')).toBe('ErrorBoundary Error');
49+
}
4550
});

0 commit comments

Comments
 (0)