- 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
26 lines
945 B
TypeScript
26 lines
945 B
TypeScript
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
import { expect, fn, userEvent, within } from 'storybook/test';
|
|
import { AutoRefreshIndicator } from '../../src/ui/AutoRefreshIndicator/AutoRefreshIndicator';
|
|
|
|
const meta: Meta<typeof AutoRefreshIndicator> = {
|
|
title: 'UI/AutoRefreshIndicator',
|
|
component: AutoRefreshIndicator,
|
|
parameters: { layout: 'centered' },
|
|
tags: ['autodocs'],
|
|
args: { onClick: fn() },
|
|
};
|
|
export default meta;
|
|
type Story = StoryObj<typeof AutoRefreshIndicator>;
|
|
|
|
export const Active: Story = { args: { active: true, pulseKey: 1 } };
|
|
export const Idle: Story = { args: { active: false } };
|
|
export const Errored: Story = { args: { active: false, error: true } };
|
|
|
|
export const ClickToRefresh: Story = {
|
|
args: { active: false },
|
|
play: async ({ args, canvasElement }) => {
|
|
await userEvent.click(within(canvasElement).getByRole('button'));
|
|
await expect(args.onClick).toHaveBeenCalled();
|
|
},
|
|
};
|