Skip to content

Commit

Permalink
moldy potato - update EuiErrorBoundary story
Browse files Browse the repository at this point in the history
- it was the first and one and therefore the worst one, and we are much better at writing stories now
  • Loading branch information
cee-chen committed Oct 2, 2023
1 parent 758cc81 commit c4f3e2c
Showing 1 changed file with 13 additions and 18 deletions.
31 changes: 13 additions & 18 deletions src/components/error_boundary/error_boundary.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,31 +11,26 @@ import type { Meta, StoryObj } from '@storybook/react';

import { EuiErrorBoundary, EuiErrorBoundaryProps } from './error_boundary';

const ErrorContent = () => {
throw new Error(
"I'm here to kick butt and chew bubblegum.\n\nAnd I'm all out of gum."
);
};

const meta: Meta<EuiErrorBoundaryProps> = {
title: 'EuiErrorBoundary',
component: () => (
<EuiErrorBoundary>
<ErrorContent />
</EuiErrorBoundary>
),
component: EuiErrorBoundary,
parameters: {
layout: 'fullscreen',
},
argTypes: {
onError: {
description:
'TODO: extract prop descriptions, defaults, and types from Typescript ',
},
},
};

export default meta;
type Story = StoryObj<EuiErrorBoundaryProps>;

export const Default: Story = {};
const ErrorContent = () => {
throw new Error(
"I'm here to kick butt and chew bubblegum.\n\nAnd I'm all out of gum."
);
};

export const Playground: Story = {
args: {
children: <ErrorContent />,
onError: console.log,
},
};

0 comments on commit c4f3e2c

Please sign in to comment.