mirror of
https://github.com/IT4Change/boilerplate-frontend.git
synced 2025-12-13 07:35:53 +00:00
add tests not working from dreammall
This commit is contained in:
parent
7e5a7f02f6
commit
3137e770fe
20
src/components/PageShell.test.ts.notworking
Normal file
20
src/components/PageShell.test.ts.notworking
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { mount } from '@vue/test-utils'
|
||||||
|
import { describe, it, expect } from 'vitest'
|
||||||
|
|
||||||
|
import TopMenu from '#components/menu/TopMenu.vue'
|
||||||
|
|
||||||
|
import PageShell from './PageShell.vue'
|
||||||
|
|
||||||
|
describe('PageShell', () => {
|
||||||
|
const wrapper = mount(PageShell, {
|
||||||
|
slots: {
|
||||||
|
default: 'Page Content',
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
it('renders page content', () => {
|
||||||
|
expect(wrapper.find('.v-application').exists()).toBeTruthy()
|
||||||
|
expect(wrapper.find('.v-application').findComponent(TopMenu)).toBeTruthy()
|
||||||
|
expect(wrapper.html()).toContain('Page Content')
|
||||||
|
})
|
||||||
|
})
|
||||||
34
src/components/menu/TopMenu.test.ts.notworking
Normal file
34
src/components/menu/TopMenu.test.ts.notworking
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import { mount } from '@vue/test-utils'
|
||||||
|
import { describe, it, expect } from 'vitest'
|
||||||
|
import { h } from 'vue'
|
||||||
|
import { VApp } from 'vuetify/components'
|
||||||
|
|
||||||
|
import VikeBtn from '#components/VikeBtn.vue'
|
||||||
|
|
||||||
|
import LogoAvatar from './LogoAvatar.vue'
|
||||||
|
import TopMenu from './TopMenu.vue'
|
||||||
|
|
||||||
|
describe('FooterMenu', () => {
|
||||||
|
const wrapper = mount(VApp, {
|
||||||
|
slots: {
|
||||||
|
default: h(TopMenu),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
it('renders three columns', () => {
|
||||||
|
expect(wrapper.find('.v-row').exists()).toBeTruthy()
|
||||||
|
expect(wrapper.findAll('.v-row > div')).toHaveLength(3)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('first column contains logo', () => {
|
||||||
|
expect(wrapper.findAll('.v-row > div')[0].findComponent(LogoAvatar)).toBeTruthy()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('second column contains 3 children -> AnchorLink', () => {
|
||||||
|
expect(wrapper.findAll('.v-row > div')[1].findAllComponents(VikeBtn)).toHaveLength(3)
|
||||||
|
})
|
||||||
|
|
||||||
|
it('third column is placeholdre', () => {
|
||||||
|
expect(wrapper.findAll('.v-row > div')[2].findAll('div')).toHaveLength(0)
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user