import * as React from 'react'; import { useArgs } from 'storybook/preview-api'; import { expect, screen, userEvent, within } from 'storybook/test'; import { Button } from '@box/blueprint-web'; import PreviewDialog from '../../preview-dialog'; import { addRootElement } from '../../../../utils/storybook'; // need to import this into the story because it's usually in ContentExplorer import '../../modal.scss'; export const basic = { play: async ({ canvasElement }) => { const canvas = within(canvasElement); const button = canvas.getByRole('button', { name: 'Launch PreviewDialog' }); await userEvent.click(button); expect(await screen.findByText('Book Sample.pdf')).toBeInTheDocument(); }, // eslint-disable-next-line @typescript-eslint/no-explicit-any render: (args: any) => { // eslint-disable-next-line react-hooks/rules-of-hooks const [, setArgs] = useArgs(); const handleOpenModal = () => setArgs({ isOpen: true }); const handleCloseModal = () => { setArgs({ isOpen: false }); }; const { appElement, rootElement } = addRootElement(); return (