Files
ui/test/components/Card.spec.ts
Benjamin Canac 959b1295f2 test: update
2024-03-13 12:27:10 +01:00

17 lines
764 B
TypeScript

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 as', { props: { as: 'section' } }],
['with class', { props: { class: 'rounded-xl' } }],
['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()
})
})