mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-27 02:10:40 +01:00
test: improve
This commit is contained in:
@@ -3,9 +3,15 @@ import Popover, { type PopoverProps, type PopoverSlots } from '../../src/runtime
|
||||
import ComponentRender from '../component-render'
|
||||
|
||||
describe('Popover', () => {
|
||||
const props = { open: true, portal: false }
|
||||
|
||||
it.each([
|
||||
// Props
|
||||
['with open', { props: { open: true, portal: false, arrow: true }, slots: { default: () => 'Click me', content: () => 'Popover content' } }]
|
||||
['with open', { props }],
|
||||
['with arrow', { props: { ...props, arrow: true } }],
|
||||
// Slots
|
||||
['with default slot', { props, slots: { default: () => 'Default slot' } }],
|
||||
['with content slot', { props, slots: { content: () => 'Content slot' } }]
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props?: PopoverProps, slots?: Partial<PopoverSlots> }) => {
|
||||
const html = await ComponentRender(nameOrHtml, options, Popover)
|
||||
expect(html).toMatchSnapshot()
|
||||
|
||||
Reference in New Issue
Block a user