mirror of
https://github.com/coder/coder.git
synced 2025-07-12 00:14:10 +00:00
32 lines
912 B
TypeScript
32 lines
912 B
TypeScript
import { ComponentMeta, Story } from "@storybook/react"
|
|
import { RuntimeErrorState, RuntimeErrorStateProps } from "./RuntimeErrorState"
|
|
|
|
const error = new Error("An error occurred")
|
|
|
|
export default {
|
|
title: "components/RuntimeErrorState",
|
|
component: RuntimeErrorState,
|
|
argTypes: {
|
|
error: {
|
|
defaultValue: error,
|
|
},
|
|
},
|
|
} as ComponentMeta<typeof RuntimeErrorState>
|
|
|
|
const Template: Story<RuntimeErrorStateProps> = (args) => (
|
|
<RuntimeErrorState {...args} />
|
|
)
|
|
|
|
export const Errored = Template.bind({})
|
|
Errored.parameters = {
|
|
// The RuntimeErrorState is noisy for chromatic, because it renders an actual error
|
|
// along with the stacktrace - and the stacktrace includes the full URL of
|
|
// scripts in the stack. This is problematic, because every deployment uses
|
|
// a different URL, causing the validation to fail.
|
|
chromatic: { disableSnapshot: true },
|
|
}
|
|
|
|
Errored.args = {
|
|
error,
|
|
}
|