mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-28 19:00:35 +01:00
test(Collapsible): add
This commit is contained in:
12
test/components/Collapsible.spec.ts
Normal file
12
test/components/Collapsible.spec.ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import Collapsible, { type CollapsibleProps } from '../../src/runtime/components/Collapsible.vue'
|
||||
import ComponentRender from '../component-render'
|
||||
|
||||
describe('Collapsible', () => {
|
||||
it.each([
|
||||
['basic case', { props: { open: true }, slots: { default: () => 'Click me', content: () => 'Collapsible content' } }]
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props?: CollapsibleProps, slots?: any }) => {
|
||||
const html = await ComponentRender(nameOrHtml, options, Collapsible)
|
||||
expect(html).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user