import type { Meta, StoryObj } from '@storybook/react-vite'; import { expect, within } from 'storybook/test'; import { MarkdownContent } from '../../src/ui/MarkdownContent/MarkdownContent'; const meta: Meta = { title: 'UI/MarkdownContent', component: MarkdownContent, parameters: { layout: 'padded' }, tags: ['autodocs'], }; export default meta; type Story = StoryObj; export const Description: Story = { args: { content: [ '## Login flow', '', 'Logs in with the **test user** and checks the dashboard.', '', '- Uses the `BASE_URL` environment value', '- Needs the `user` credential alias', '', '```js', "await context.page.goto(context.getEnv('BASE_URL'));", '```', ].join('\n'), }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); await expect(canvas.getByRole('heading', { name: 'Login flow' })).toBeInTheDocument(); await expect(canvas.getByText('test user').tagName).toBe('STRONG'); await expect(canvas.getAllByRole('listitem')).toHaveLength(2); }, };