Skip to content

Commit 9b01bdf

Browse files
committed
Test error boundary rendering on v2 integration tests.
1 parent a4dabb7 commit 9b01bdf

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
@@ -999,6 +999,7 @@ jobs:
999999
'create-remix-app',
10001000
'create-remix-app-legacy',
10011001
'create-remix-app-v2',
1002+
'create-remix-app-v2-legacy',
10021003
'create-remix-app-express',
10031004
'create-remix-app-express-vite-dev',
10041005
'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)