31 lines
776 B
TypeScript
31 lines
776 B
TypeScript
import { renderSuspended } from '@nuxt/test-utils/runtime'
|
|
import { describe, expect, it } from 'vitest'
|
|
|
|
import { AppContainer } from '#components'
|
|
import type { NavSecondaryItem } from '~/components/nav/Secondary.vue'
|
|
|
|
describe('AppContainer', () => {
|
|
const testNavSecondary: NavSecondaryItem[] = [
|
|
{
|
|
label: 'Home',
|
|
to: '/'
|
|
},
|
|
{
|
|
label: 'Test',
|
|
to: '/test'
|
|
},
|
|
]
|
|
it('renders properly', async () => {
|
|
const appContainer = await renderSuspended(AppContainer, {
|
|
props: {
|
|
navSecondary: testNavSecondary
|
|
},
|
|
})
|
|
|
|
expect(appContainer).toBeTruthy()
|
|
expect(appContainer.html()).toContain('Home')
|
|
expect(appContainer.html()).toContain('Test')
|
|
expect(appContainer.html()).toMatchSnapshot()
|
|
})
|
|
})
|