mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
20 lines
801 B
TypeScript
20 lines
801 B
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import Popover, { type PopoverProps, type PopoverSlots } from '../../src/runtime/components/Popover.vue'
|
|
import ComponentRender from '../component-render'
|
|
|
|
describe('Popover', () => {
|
|
const props = { open: true, portal: false }
|
|
|
|
it.each([
|
|
// Props
|
|
['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()
|
|
})
|
|
})
|