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 RadioGroup, { type RadioGroupProps } from '../../src/runtime/components/RadioGroup.vue'
import RadioGroup, { type RadioGroupProps, type RadioGroupSlots } from '../../src/runtime/components/RadioGroup.vue'
import ComponentRender from '../component-render'
import theme from '#build/ui/radio-group'
@@ -27,7 +27,7 @@ describe('RadioGroup', () => {
['with legend slot', { props: { options }, slots: { label: () => 'Legend slot' } }],
['with label slot', { props: { options }, slots: { label: () => 'Label slot' } }],
['with description slot', { slots: { label: () => 'Description slot' } }]
])('renders %s correctly', async (nameOrHtml: string, options: { props?: RadioGroupProps<any>, slots?: any }) => {
])('renders %s correctly', async (nameOrHtml: string, options: { props?: RadioGroupProps<any>, slots?: Partial<RadioGroupSlots<any>> }) => {
const html = await ComponentRender(nameOrHtml, options, RadioGroup)
expect(html).toMatchSnapshot()
})