mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-23 00:15:05 +01:00
feat: uniformize components sizes (#68)
This commit is contained in:
@@ -1,23 +1,19 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import Avatar, { type AvatarProps } from '../../src/runtime/components/Avatar.vue'
|
||||
import ComponentRender from '../component-render'
|
||||
import theme from '#build/ui/avatar'
|
||||
|
||||
describe('Avatar', () => {
|
||||
const sizes = Object.keys(theme.variants.size) as any
|
||||
|
||||
it.each([
|
||||
// Props
|
||||
['with src', { props: { src: 'https://avatars.githubusercontent.com/u/739984?v=4' } }],
|
||||
['with alt', { props: { alt: 'Benjamin Canac' } }],
|
||||
['with class', { props: { class: 'bg-white dark:bg-gray-900' } }],
|
||||
['with text', { props: { text: '+1' } }],
|
||||
['with icon', { props: { icon: 'i-heroicons-photo' } }],
|
||||
['with size 3xs', { props: { size: '3xs' as const } }],
|
||||
['with size 2xs', { props: { size: '2xs' as const } }],
|
||||
['with size xs', { props: { size: 'xs' as const } }],
|
||||
['with size sm', { props: { size: 'sm' as const } }],
|
||||
['with size md', { props: { size: 'md' as const } }],
|
||||
['with size lg', { props: { size: 'lg' as const } }],
|
||||
['with size xl', { props: { size: 'xl' as const } }],
|
||||
['with size 2xl', { props: { size: '2xl' as const } }],
|
||||
['with size 3xl', { props: { size: '3xl' as const } }],
|
||||
...sizes.map((size: string) => [`with size ${size}`, { props: { src: 'https://avatars.githubusercontent.com/u/739984?v=4', size } }]),
|
||||
['with class', { props: { class: 'bg-white dark:bg-gray-900' } }],
|
||||
['with ui', { props: { ui: { fallback: 'font-bold' } } }]
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props?: AvatarProps, slots?: any }) => {
|
||||
const html = await ComponentRender(nameOrHtml, options, Avatar)
|
||||
|
||||
Reference in New Issue
Block a user