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

@@ -8,7 +8,7 @@ import * as yup from 'yup'
import Joi from 'joi'
import * as valibot from 'valibot'
import ComponentRender from '../component-render'
import type { FormProps } from '../../src/runtime/components/Form.vue'
import type { FormProps, FormSlots } from '../../src/runtime/components/Form.vue'
import {
UForm,
UInput,
@@ -75,8 +75,8 @@ describe('Form', () => {
// Props
['with state', { props: { state: {} } }],
// Slots
['with default slot', { props: { state: {} }, slots: { default: 'Form slot' } }]
])('renders %s correctly', async (nameOrHtml: string, options: { props: FormProps<any> }) => {
['with default slot', { props: { state: {} }, slots: { default: () => 'Form slot' } }]
])('renders %s correctly', async (nameOrHtml: string, options: { props: FormProps<any>, slots?: Partial<FormSlots> }) => {
const html = await ComponentRender(nameOrHtml, options, UForm)
expect(html).toMatchSnapshot()
})