feat(Card): new component

This commit is contained in:
Benjamin Canac
2024-03-12 16:07:46 +01:00
parent 69b281c408
commit 78908c3d64
5 changed files with 97 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
import { describe, it, expect } from 'vitest'
import Card, { type CardProps } from '../../src/runtime/components/Card.vue'
import ComponentRender from '../component-render'
describe('Card', () => {
it.each([
['basic case', {}],
['with default slot', { slots: { default: () => 'Default slot' } }],
['with header slot', { slots: { header: () => 'Header slot' } }],
['with footer slot', { slots: { footer: () => 'Footer slot' } }]
])('renders %s correctly', async (nameOrHtml: string, options: { props?: CardProps, slots?: any }) => {
const html = await ComponentRender(nameOrHtml, options, Card)
expect(html).toMatchSnapshot()
})
})