import type { Meta, StoryObj } from '@storybook/react'; import { action } from 'storybook/actions'; import { within, userEvent } from 'storybook/test'; import React, { useState } from 'react'; import { Button } from '../../Button'; import { Modal } from '../Modal'; import { Select } from '../../Select'; const meta: Meta = { title: 'Feedback/Modal', component: Modal, args: { title: 'Modal Title', children: 'This is placeholder text. The basic dialog for modals should contain only valuable and relevant information. Simplify dialogs by removing unnecessary elements or content that do not support user tasks.', }, parameters: { layout: 'centered', chromatic: { disableSnapshot: false }, }, }; export default meta; type Story = StoryObj; export const Default: Story = { args: { iconName: 'sparkle', iconVariant: 'info', }, play: async ({ canvasElement }) => { const canvas = within(canvasElement); const openButton = canvas.getByRole('button', { name: 'Open the modal', }); await userEvent.click(openButton); }, render: (args) => { const [isOpen, setIsOpen] = useState(false); return ( <>