mirror of
https://github.com/nuxt/ui.git
synced 2026-09-14 19:51:10 +08:00
5cb65cfbd0
Co-authored-by: Hugo Richard <hugo.richard@epitech.eu>
21 lines
1.0 KiB
TypeScript
21 lines
1.0 KiB
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import DashboardToolbar from '../../src/runtime/components/DashboardToolbar.vue'
|
|
import type { DashboardToolbarProps, DashboardToolbarSlots } from '../../src/runtime/components/DashboardToolbar.vue'
|
|
import ComponentRender from '../component-render'
|
|
|
|
describe('DashboardToolbar', () => {
|
|
it.each([
|
|
// Props
|
|
['with as', { props: { as: 'section' } }],
|
|
['with class', { props: { class: 'px-8' } }],
|
|
['with ui', { props: { ui: { left: 'items-center' } }, slots: { left: (): string => 'Left slot' } }],
|
|
// Slots
|
|
['with default slot', { slots: { default: (): string => 'Default slot' } }],
|
|
['with left slot', { slots: { left: (): string => 'Left slot' } }],
|
|
['with right slot', { slots: { right: (): string => 'Right slot' } }]
|
|
])('renders %s correctly', async (nameOrHtml: string, options: { props?: DashboardToolbarProps, slots?: Partial<DashboardToolbarSlots> }) => {
|
|
const html = await ComponentRender(nameOrHtml, options, DashboardToolbar)
|
|
expect(html).toMatchSnapshot()
|
|
})
|
|
})
|