import { StoryObj } from '@storybook/react-webpack5'; import { userEvent, within } from 'storybook/test'; import TextareaWithDisplayFormat from './TextareaWithDisplayFormat'; import { Field } from '../field/Field'; export default { component: TextareaWithDisplayFormat, title: 'Forms/TextareaWithDisplayFormat', }; type Story = StoryObj; export const Basic: Story = { render: () => { const label = 'Textarea with display format'; const id = label.replaceAll(' ', '-').toLowerCase(); return ( ); }, // intentionally use interactive typing (over init value via `value` prop) // to trigger event handlers in the component play: async ({ canvasElement }) => { const canvas = within(canvasElement); await userEvent.type(canvas.getByRole('textbox'), '111122223333', { initialSelectionStart: Number.MAX_SAFE_INTEGER, }); }, };