Files
ui/test/components/Container.spec.ts
Benjamin Canac 9a42fa415f chore: add eol
2024-03-13 16:58:11 +01:00

16 lines
654 B
TypeScript

import { describe, it, expect } from 'vitest'
import Container, { type ContainerProps } from '../../src/runtime/components/Container.vue'
import ComponentRender from '../component-render'
describe('Container', () => {
it.each([
['basic case', {}],
['with as', { props: { as: 'article' } }],
['with class', { props: { class: 'max-w-5xl' } }],
['with default slot', { slots: { default: () => 'Default slot' } }]
])('renders %s correctly', async (nameOrHtml: string, options: { props?: ContainerProps, slots?: any }) => {
const html = await ComponentRender(nameOrHtml, options, Container)
expect(html).toMatchSnapshot()
})
})