mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
test: type options slots
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { defineComponent } from 'vue'
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import { TooltipProvider } from 'radix-vue'
|
||||
import Tooltip, { type TooltipProps } from '../../src/runtime/components/Tooltip.vue'
|
||||
import Tooltip, { type TooltipProps, type TooltipSlots } from '../../src/runtime/components/Tooltip.vue'
|
||||
import ComponentRender from '../component-render'
|
||||
|
||||
const TooltipWrapper = defineComponent({
|
||||
@@ -22,7 +22,7 @@ describe('Tooltip', () => {
|
||||
// Slots
|
||||
['with default slot', { props: { text: 'Tooltip', shortcuts: ['⌘', 'K'], open: true, portal: false }, slots: { default: () => 'Default slot' } }],
|
||||
['with content slot', { props: { open: true, portal: false }, slots: { content: () => 'Content slot' } }]
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props?: TooltipProps, slots?: any }) => {
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props?: TooltipProps, slots?: Partial<TooltipSlots> }) => {
|
||||
const html = await ComponentRender(nameOrHtml, options, TooltipWrapper)
|
||||
expect(html).toMatchSnapshot()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user