-
Notifications
You must be signed in to change notification settings - Fork 27.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[DevOverlay] Add Basic Stories for Error Containers (#74697)
This PR added stories for Error containers: `Errors`, `BuildError`, `RootLayoutMissingTagsError`. Note: Filenames are Pascal for now to benefit the vscode file nesting. Will change all to kebab in once.
- Loading branch information
1 parent
91cfa64
commit 5929cf7
Showing
3 changed files
with
159 additions
and
12 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
...ient/components/react-dev-overlay/_experimental/internal/container/BuildError.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { BuildError } from './BuildError' | ||
import { withShadowPortal } from '../storybook/with-shadow-portal' | ||
|
||
const meta: Meta<typeof BuildError> = { | ||
title: 'BuildError', | ||
component: BuildError, | ||
parameters: { | ||
layout: 'fullscreen', | ||
}, | ||
decorators: [withShadowPortal], | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof BuildError> | ||
|
||
export const Default: Story = { | ||
args: { | ||
message: `./src/app/page.tsx:3:3 | ||
Parsing ecmascript source code failed | ||
1 | export default function Home() { | ||
2 | const | ||
> 3 | return <div>Hello World</div> | ||
| ^^^^^^ | ||
4 | } | ||
5 | | ||
Expected identError: Failed to resolve import "./missing-module"`, | ||
versionInfo: { | ||
installed: '15.0.0', | ||
staleness: 'fresh', | ||
}, | ||
}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
...react-dev-overlay/_experimental/internal/container/RootLayoutMissingTagsError.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import type { Meta, StoryObj } from '@storybook/react' | ||
import { RootLayoutMissingTagsError } from './RootLayoutMissingTagsError' | ||
import { withShadowPortal } from '../storybook/with-shadow-portal' | ||
|
||
const meta: Meta<typeof RootLayoutMissingTagsError> = { | ||
title: 'RootLayoutMissingTagsError', | ||
component: RootLayoutMissingTagsError, | ||
parameters: { | ||
layout: 'fullscreen', | ||
}, | ||
decorators: [withShadowPortal], | ||
} | ||
|
||
export default meta | ||
type Story = StoryObj<typeof RootLayoutMissingTagsError> | ||
|
||
export const Default: Story = { | ||
args: { | ||
missingTags: ['html', 'body'], | ||
versionInfo: { | ||
installed: '15.0.0', | ||
staleness: 'fresh', | ||
}, | ||
}, | ||
} | ||
|
||
export const SingleTag: Story = { | ||
args: { | ||
missingTags: ['html'], | ||
versionInfo: { | ||
installed: '15.0.0', | ||
staleness: 'fresh', | ||
}, | ||
}, | ||
} |