mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-30 11:47:55 +01:00
chore: add local module for better development dx (#2)
* chore: add local module for better dx developing nuxt/ui * up * up * up * feat(Kbd): new * chore(Badge): update * chore(Collapsible): remove content prop * chore(Container): clean * chore(Avatar): update root bg * chore(Link): clean * feat(Tooltip): handle shortcuts * playground(collapsible): update --------- Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
17
test/components/Kbd.spec.ts
Normal file
17
test/components/Kbd.spec.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import Kbd, { type KbdProps } from '../../src/runtime/components/Kbd.vue'
|
||||
import ComponentRender from '../component-render'
|
||||
|
||||
describe('Kbd', () => {
|
||||
it.each([
|
||||
['with value', { props: { value: 'K' } }],
|
||||
['with class', { props: { value: 'K', class: 'font-bold' } }],
|
||||
['with size xs', { props: { value: 'K', size: 'xs' as const } }],
|
||||
['with size sm', { props: { value: 'K', size: 'sm' as const } }],
|
||||
['with size md', { props: { value: 'K', size: 'md' as const } }],
|
||||
['with default slot', { slots: { default: () => 'Default slot' } }]
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props?: KbdProps, slots?: any }) => {
|
||||
const html = await ComponentRender(nameOrHtml, options, Kbd)
|
||||
expect(html).toMatchSnapshot()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user