Files
coder/site/src/components/RuntimeErrorState/RuntimeErrorState.stories.tsx
2022-10-10 10:33:35 -07:00

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,
}