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,5 +1,5 @@
import { describe, it, expect } from 'vitest'
import Modal, { type ModalProps } from '../../src/runtime/components/Modal.vue'
import Modal, { type ModalProps, type ModalSlots } from '../../src/runtime/components/Modal.vue'
import ComponentRender from '../component-render'
describe('Modal', () => {
@@ -23,7 +23,7 @@ describe('Modal', () => {
['with close slot', { props: { open: true, portal: false }, slots: { close: () => 'Close slot' } }],
['with body slot', { props: { open: true, portal: false }, slots: { body: () => 'Body slot' } }],
['with footer slot', { props: { open: true, portal: false }, slots: { footer: () => 'Footer slot' } }]
])('renders %s correctly', async (nameOrHtml: string, options: { props?: ModalProps, slots?: any }) => {
])('renders %s correctly', async (nameOrHtml: string, options: { props?: ModalProps, slots?: Partial<ModalSlots> }) => {
const html = await ComponentRender(nameOrHtml, options, Modal)
expect(html).toMatchSnapshot()
})