mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-25 09:20:36 +01:00
test: update
This commit is contained in:
17
test/components/Link.spec.ts
Normal file
17
test/components/Link.spec.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import Link, { type LinkProps } from '../../src/runtime/components/Link.vue'
|
||||
import ComponentRender from '../component-render'
|
||||
|
||||
describe('Link', () => {
|
||||
it.each([
|
||||
['with as', { props: { as: 'div' } }],
|
||||
['with to', { props: { to: '/' } }],
|
||||
['with type', { props: { type: 'submit' } }],
|
||||
['with disabled', { props: { disabled: true } }],
|
||||
['with activeClass', { props: { active: true, to: '/', activeClass: 'text-sm' } }],
|
||||
['with inactiveClass', { props: { active: false, to: '/', inactiveClass: 'text-gray-300' } }]
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props: LinkProps }) => {
|
||||
const html = await ComponentRender(nameOrHtml, options, Link)
|
||||
expect(html).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user