mirror of
https://github.com/nuxt/ui.git
synced 2026-09-14 19:51:10 +08:00
7d1e8631ea
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
25 lines
977 B
TypeScript
25 lines
977 B
TypeScript
import { describe, it, expect } from 'vitest'
|
|
import { axe } from 'vitest-axe'
|
|
import { mountSuspended } from '@nuxt/test-utils/runtime'
|
|
import { renderEach } from '../component-render'
|
|
import DashboardToolbar from '../../src/runtime/components/DashboardToolbar.vue'
|
|
|
|
describe('DashboardToolbar', () => {
|
|
renderEach(DashboardToolbar, [
|
|
// 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' } }]
|
|
])
|
|
|
|
it('passes accessibility tests', async () => {
|
|
const wrapper = await mountSuspended(DashboardToolbar)
|
|
|
|
expect(await axe(wrapper.element)).toHaveNoViolations()
|
|
})
|
|
})
|