mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-21 23:40:39 +01:00
feat: uniformize components sizes (#68)
This commit is contained in:
@@ -1,18 +1,20 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import Kbd, { type KbdProps } from '../../src/runtime/components/Kbd.vue'
|
||||
import ComponentRender from '../component-render'
|
||||
import theme from '#build/ui/kbd'
|
||||
|
||||
describe('Kbd', () => {
|
||||
const sizes = Object.keys(theme.variants.size) as any
|
||||
const colors = Object.keys(theme.variants.color) as any
|
||||
|
||||
it.each([
|
||||
// Props
|
||||
['with value', { props: { value: 'K' } }],
|
||||
['with as', { props: { value: 'K', as: 'span' } }],
|
||||
...sizes.map((size: string) => [`with size ${size}`, { props: { value: 'K', size } }]),
|
||||
...colors.map((color: string) => [`with color ${color}`, { props: { value: 'K', color } }]),
|
||||
['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 color white', { props: { value: 'K', color: 'white' as const } }],
|
||||
['with color gray', { props: { value: 'K', color: 'gray' as const } }],
|
||||
['with color black', { props: { value: 'K', color: 'black' as const } }],
|
||||
// Slots
|
||||
['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)
|
||||
|
||||
Reference in New Issue
Block a user