feat(DropdownMenu): handle size prop (#125)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Silver343
2024-06-19 10:50:25 +01:00
committed by GitHub
parent 5b2e7d8bad
commit dfa99362d4
12 changed files with 1753 additions and 1162 deletions

View File

@@ -1,8 +1,11 @@
import { describe, it, expect } from 'vitest'
import DropdownMenu, { type DropdownMenuProps, type DropdownMenuSlots } from '../../src/runtime/components/DropdownMenu.vue'
import ComponentRender from '../component-render'
import theme from '#build/ui/dropdown-menu'
describe('DropdownMenu', () => {
const sizes = Object.keys(theme.variants.size) as any
const items = [
[{
label: 'My account',
@@ -122,6 +125,8 @@ describe('DropdownMenu', () => {
// Props
['with items', { props }],
['with disabled', { props: { ...props, disabled: true } }],
['with arrow', { props: { ...props, arrow: true } }],
...sizes.map((size: string) => [`with size ${size}`, { props: { ...props, size } }]),
['with class', { props: { ...props, class: 'min-w-96' } }],
['with ui', { props: { ...props, ui: { itemLeadingIcon: 'size-4' } } }],
// Slots