mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
feat(ContextMenu): handle size prop (#130)
This commit is contained in:
@@ -1,9 +1,12 @@
|
||||
import { describe, it, expect } from 'vitest'
|
||||
import ContextMenu, { type ContextMenuProps, type ContextMenuSlots } from '../../src/runtime/components/ContextMenu.vue'
|
||||
import ComponentRender from '../component-render'
|
||||
import theme from '#build/ui/context-menu'
|
||||
|
||||
// FIXME: Can't force open state
|
||||
describe('ContextMenu', () => {
|
||||
const sizes = Object.keys(theme.variants.size as any)
|
||||
|
||||
const items = [
|
||||
[{
|
||||
label: 'Appearance',
|
||||
@@ -78,6 +81,7 @@ describe('ContextMenu', () => {
|
||||
// Props
|
||||
['with items', { props }],
|
||||
['with disabled', { props: { ...props, disabled: 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
|
||||
|
||||
@@ -114,6 +114,71 @@ exports[`ContextMenu > renders with items correctly 1`] = `
|
||||
|
||||
|
||||
|
||||
<!--teleport end-->"
|
||||
`;
|
||||
|
||||
exports[`ContextMenu > renders with size lg correctly 1`] = `
|
||||
"<!--v-if-->
|
||||
<!--teleport start-->
|
||||
|
||||
|
||||
|
||||
<!---->
|
||||
|
||||
|
||||
|
||||
<!--teleport end-->"
|
||||
`;
|
||||
|
||||
exports[`ContextMenu > renders with size md correctly 1`] = `
|
||||
"<!--v-if-->
|
||||
<!--teleport start-->
|
||||
|
||||
|
||||
|
||||
<!---->
|
||||
|
||||
|
||||
|
||||
<!--teleport end-->"
|
||||
`;
|
||||
|
||||
exports[`ContextMenu > renders with size sm correctly 1`] = `
|
||||
"<!--v-if-->
|
||||
<!--teleport start-->
|
||||
|
||||
|
||||
|
||||
<!---->
|
||||
|
||||
|
||||
|
||||
<!--teleport end-->"
|
||||
`;
|
||||
|
||||
exports[`ContextMenu > renders with size xl correctly 1`] = `
|
||||
"<!--v-if-->
|
||||
<!--teleport start-->
|
||||
|
||||
|
||||
|
||||
<!---->
|
||||
|
||||
|
||||
|
||||
<!--teleport end-->"
|
||||
`;
|
||||
|
||||
exports[`ContextMenu > renders with size xs correctly 1`] = `
|
||||
"<!--v-if-->
|
||||
<!--teleport start-->
|
||||
|
||||
|
||||
|
||||
<!---->
|
||||
|
||||
|
||||
|
||||
<!--teleport end-->"
|
||||
`;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user