mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 12:14:41 +01:00
feat: uniformize components sizes (#68)
This commit is contained in:
@@ -2,28 +2,30 @@ import { describe, it, expect } from 'vitest'
|
||||
import Tabs, { type TabsProps } from '../../src/runtime/components/Tabs.vue'
|
||||
import ComponentRender from '../component-render'
|
||||
|
||||
const items = [{
|
||||
label: 'Tab1',
|
||||
icon: 'i-heroicons-home',
|
||||
content: 'This is the content shown for Tab1'
|
||||
}, {
|
||||
label: 'Tab2',
|
||||
icon: 'i-heroicons-user',
|
||||
content: 'And, this is the content for Tab2'
|
||||
}, {
|
||||
label: 'Tab3',
|
||||
icon: 'i-heroicons-bell',
|
||||
content: 'Finally, this is the content for Tab3'
|
||||
}]
|
||||
|
||||
describe('Tabs', () => {
|
||||
const items = [{
|
||||
label: 'Tab1',
|
||||
icon: 'i-heroicons-home',
|
||||
content: 'This is the content shown for Tab1'
|
||||
}, {
|
||||
label: 'Tab2',
|
||||
icon: 'i-heroicons-user',
|
||||
content: 'And, this is the content for Tab2'
|
||||
}, {
|
||||
label: 'Tab3',
|
||||
icon: 'i-heroicons-bell',
|
||||
content: 'Finally, this is the content for Tab3'
|
||||
}]
|
||||
|
||||
it.each([
|
||||
['basic case', { props: { items } }],
|
||||
['with class', { props: { items, class: 'w-96' } }],
|
||||
['with ui', { props: { items, ui: { content: 'w-full ring ring-gray-200 dark:ring-gray-800' } } }],
|
||||
['with orientation', { props: { items, orientation: 'vertical' as const } }],
|
||||
// Props
|
||||
['with items', { props: { items } }],
|
||||
['with modelValue', { props: { items, modelValue: '1' } }],
|
||||
['with defaultValue', { props: { items, defaultValue: '1' } }],
|
||||
['with orientation vertical', { props: { items, orientation: 'vertical' as const } }],
|
||||
['with class', { props: { items, class: 'w-96' } }],
|
||||
['with ui', { props: { items, ui: { content: 'w-full ring ring-gray-200 dark:ring-gray-800' } } }],
|
||||
// Slots
|
||||
['with default slot', { props: { items }, slots: { default: () => 'Default slot' } }],
|
||||
['with content slot', { props: { items }, slots: { content: () => 'Content slot' } }]
|
||||
])('renders %s correctly', async (nameOrHtml: string, options: { props?: TabsProps<typeof items[number]>, slots?: any }) => {
|
||||
|
||||
Reference in New Issue
Block a user