- update client and server dependencies within their ranges, keeping all playwright packages aligned at 1.63 - fix code flagged by react-hooks 7.1: refs written during render and synchronous setState in effects - add stories for the ui components that had none, with interaction tests, and cover all DescriptionList layouts - drop the unused mdx stories pattern - run the storybook tests as part of the pre-commit checks - bump version to 1.20.1
36 lines
1.1 KiB
TypeScript
36 lines
1.1 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
import { expect, within } from 'storybook/test';
|
|
import { MarkdownContent } from '../../src/ui/MarkdownContent/MarkdownContent';
|
|
|
|
const meta: Meta<typeof MarkdownContent> = {
|
|
title: 'UI/MarkdownContent',
|
|
component: MarkdownContent,
|
|
parameters: { layout: 'padded' },
|
|
tags: ['autodocs'],
|
|
};
|
|
export default meta;
|
|
type Story = StoryObj<typeof MarkdownContent>;
|
|
|
|
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);
|
|
},
|
|
};
|