test: type options slots

This commit is contained in:
Benjamin Canac
2024-04-18 12:55:10 +02:00
parent 76e3d0b9f3
commit ae2aaa9d1a
44 changed files with 524 additions and 524 deletions

View File

@@ -1,12 +1,12 @@
import { describe, it, expect } from 'vitest'
import Popover, { type PopoverProps } from '../../src/runtime/components/Popover.vue'
import Popover, { type PopoverProps, type PopoverSlots } from '../../src/runtime/components/Popover.vue'
import ComponentRender from '../component-render'
describe('Popover', () => {
it.each([
// Props
['with open', { props: { open: true, portal: false, arrow: true }, slots: { default: () => 'Click me', content: () => 'Popover content' } }]
])('renders %s correctly', async (nameOrHtml: string, options: { props?: PopoverProps, slots?: any }) => {
])('renders %s correctly', async (nameOrHtml: string, options: { props?: PopoverProps, slots?: Partial<PopoverSlots> }) => {
const html = await ComponentRender(nameOrHtml, options, Popover)
expect(html).toMatchSnapshot()
})