feat: uniformize components sizes (#68)

This commit is contained in:
Benjamin Canac
2024-04-16 12:26:29 +02:00
committed by GitHub
parent 78e45600de
commit f302a15972
96 changed files with 1854 additions and 1720 deletions

View File

@@ -2,32 +2,33 @@ import { describe, it, expect } from 'vitest'
import NavigationMenu, { type NavigationMenuProps } from '../../src/runtime/components/NavigationMenu.vue'
import ComponentRender from '../component-render'
const links = [{
label: 'Profile',
avatar: {
src: 'https://avatars.githubusercontent.com/u/739984?v=4'
},
badge: 100
}, {
label: 'Modal',
icon: 'i-heroicons-home',
to: '/modal'
}, {
label: 'NavigationMenu',
icon: 'i-heroicons-chart-bar',
to: '/navigation-menu'
}, {
label: 'Popover',
icon: 'i-heroicons-command-line',
to: '/popover'
}]
describe('NavigationMenu', () => {
const links = [{
label: 'Profile',
avatar: {
src: 'https://avatars.githubusercontent.com/u/739984?v=4'
},
badge: 100
}, {
label: 'Modal',
icon: 'i-heroicons-home',
to: '/modal'
}, {
label: 'NavigationMenu',
icon: 'i-heroicons-chart-bar',
to: '/navigation-menu'
}, {
label: 'Popover',
icon: 'i-heroicons-command-line',
to: '/popover'
}]
it.each([
['basic case', { props: { links } }],
['with vertical orientation', { props: { links, orientation: 'vertical' as const } }],
// Props
['with links', { props: { links } }],
['with orientation vertical', { props: { links, orientation: 'vertical' as const } }],
['with class', { props: { links, class: 'w-48' } }],
['with ui', { props: { links, ui: { linkLeadingIcon: 'size-4' } } }]
['with ui', { props: { links, ui: { links, linkLeadingIcon: 'size-4' } } }]
])('renders %s correctly', async (nameOrHtml: string, options: { props?: NavigationMenuProps<typeof links[number]>, slots?: any }) => {
const html = await ComponentRender(nameOrHtml, options, NavigationMenu)
expect(html).toMatchSnapshot()