import type { Meta, StoryObj } from '@storybook/react'; import React, { useState } from 'react'; import { within, userEvent } from 'storybook/test'; import { PageModal } from '../PageModal'; import { Button } from '../../Button'; const meta: Meta = { title: 'Feedback/PageModal', component: PageModal, parameters: { chromatic: { disableSnapshot: false }, }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const openButton = canvas.getByRole('button', { name: 'Open the modal', }); await userEvent.click(openButton); }, }; export default meta; type Story = StoryObj; export const Default: Story = { render: (args) => { const [isOpen, setIsOpen] = useState(false); return (
); }, };