diff --git a/src/runtime/components/Tooltip.vue b/src/runtime/components/Tooltip.vue index 6deb4dd7..0972db08 100644 --- a/src/runtime/components/Tooltip.vue +++ b/src/runtime/components/Tooltip.vue @@ -25,8 +25,6 @@ export interface TooltipEmits extends TooltipRootEmits {} export interface TooltipSlots { default(): any content(): any - text(): any - shortcuts(): any } @@ -57,14 +55,10 @@ const ui = computed(() => tv({ extend: tooltip, slots: props.ui })({ side: conte - - {{ text }} - + {{ text }} - - - - + + diff --git a/test/components/Tooltip.spec.ts b/test/components/Tooltip.spec.ts index 43e4572e..5992c433 100644 --- a/test/components/Tooltip.spec.ts +++ b/test/components/Tooltip.spec.ts @@ -20,7 +20,8 @@ describe('Tooltip', () => { ['with arrow', { props: { text: 'Tooltip', arrow: true, open: true, portal: false } }], ['with shortcuts', { props: { text: 'Tooltip', shortcuts: ['⌘', 'K'], open: true, portal: false } }], // Slots - ['with default slot', { props: { text: 'Tooltip', shortcuts: ['⌘', 'K'], open: true, portal: false }, slots: { default: () => 'Default slot' } }] + ['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 }) => { const html = await ComponentRender(nameOrHtml, options, TooltipWrapper) expect(html).toMatchSnapshot() diff --git a/test/components/__snapshots__/Tooltip.spec.ts.snap b/test/components/__snapshots__/Tooltip.spec.ts.snap index c33c53bb..bb5fe178 100644 --- a/test/components/__snapshots__/Tooltip.spec.ts.snap +++ b/test/components/__snapshots__/Tooltip.spec.ts.snap @@ -11,6 +11,18 @@ exports[`Tooltip > renders with arrow correctly 1`] = ` +" +`; + +exports[`Tooltip > renders with content slot correctly 1`] = ` +" + + +
+
+
+ + " `;