import type { Meta, StoryObj } from '@storybook/react-vite' import { useState } from 'react' import { expect, within } from 'storybook/test' import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from './select' function Controlled() { const [value, setValue] = useState('') return ( ) } const meta = { component: Select, tags: ['ai-generated'], render: () => , } satisfies Meta export default meta type Story = StoryObj export const Default: Story = { play: async ({ canvas, userEvent }) => { await userEvent.click(canvas.getByRole('combobox', { name: 'Fruit' })) await userEvent.click(await within(document.body).findByRole('option', { name: 'Pear' })) await expect(canvas.getByRole('combobox', { name: 'Fruit' })).toHaveTextContent('Pear') }, }