Files
nuxt__ui/test/components/ChatPalette.spec.ts
2026-03-02 13:57:26 +01:00

24 lines
821 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 ChatPalette from '../../src/runtime/components/ChatPalette.vue'
describe('ChatPalette', () => {
renderEach(ChatPalette, [
// Props
['with as', { props: { as: 'section' } }],
['with class', { props: { class: 'absolute' } }],
['with ui', { props: { ui: { prompt: 'py-5' } } }],
// Slots
['with default slot', { slots: { default: () => 'Default slot' } }],
['with prompt slot', { slots: { prompt: () => 'Prompt slot' } }]
])
it('passes accessibility tests', async () => {
const wrapper = await mountSuspended(ChatPalette)
expect(await axe(wrapper.element)).toHaveNoViolations()
})
})