OperationCode/front-end

View on GitHub
components/ScreenReaderOnly/__stories__/ScreenReaderOnly.stories.tsx

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { Meta, StoryObj } from '@storybook/react';
import ScreenReaderOnly from '../ScreenReaderOnly';

type ScreenReaderOnlyStoryType = StoryObj<typeof ScreenReaderOnly>;

const meta: Meta<typeof ScreenReaderOnly> = {
  title: 'ScreenReaderOnly',
  component: ScreenReaderOnly,
  args: {
    children: 'ScreenReader content',
  },
  decorators: [
    ScreenReaderOnlyStory => (
      <>
        <span>Content never displayed, but it is rendered</span>
        <ScreenReaderOnlyStory />
      </>
    ),
  ],
};

export default meta;

export const Default: ScreenReaderOnlyStoryType = {
  render: args => <ScreenReaderOnly {...args} />,
};