import type { Meta, StoryObj } from '@storybook/react-vite'; import { expect, screen, userEvent, within } from 'storybook/test'; import ToastProvider from '../app/components/toast/ToastProvider'; import { dismissToasts, showErrorToast, showInfoToast, showSuccessToast, } from '../app/components/toast/toast'; const toastDescription = `Theme-aware toast feedback built on react-hot-toast. Use this page to trigger success, error, and info messages, check icon contrast and surface styling, and confirm notifications feel consistent across Biergarten themes.`; function ToastDemo() { return (

Toast demo

Use these actions to preview toast styles.

); } const meta = { title: 'Feedback/Toast', component: ToastDemo, tags: ['autodocs'], parameters: { docs: { description: { component: toastDescription, }, }, }, } satisfies Meta; export default meta; type Story = StoryObj; export const Playground: Story = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); await userEvent.click(canvas.getByRole('button', { name: /success/i })); await expect(screen.getByText(/saved successfully/i)).toBeInTheDocument(); }, };