fixed test for components

This commit is contained in:
ogerly 2022-05-17 09:23:30 +02:00
parent deb53d2c8f
commit 71446dd1dd
2 changed files with 45 additions and 18 deletions

View File

@ -56,7 +56,7 @@
</template>
<script>
export default {
name: 'MobileStart',
name: 'AuthMobileStart',
}
</script>
<style>

View File

@ -34,30 +34,57 @@ describe('AuthLayoutGdd', () => {
beforeEach(() => {
wrapper = Wrapper()
})
describe('Mobile Version Start', () => {
beforeEach(() => {
wrapper.vm.mobileStart = true
})
it('has Component AuthHeader', () => {
expect(wrapper.findComponent({ name: 'AuthNavbar' }).exists()).toBe(true)
it('has Component AuthMobileStart', () => {
expect(wrapper.findComponent({ name: 'AuthMobileStart' }).exists()).toBe(true)
})
it('has Component AuthNavbar', () => {
expect(wrapper.findComponent({ name: 'AuthNavbar' }).exists()).toBe(false)
})
it('has Component AuthCarousel', () => {
expect(wrapper.findComponent({ name: 'AuthCarousel' }).exists()).toBe(false)
})
it('has Component AuthFooter', () => {
expect(wrapper.findComponent({ name: 'AuthFooter' }).exists()).toBe(false)
})
})
it('has Component AuthCarousel', () => {
expect(wrapper.findComponent({ name: 'AuthCarousel' }).exists()).toBe(true)
})
describe('Desktop Version Start', () => {
beforeEach(() => {
wrapper.vm.mobileStart = false
})
it('has Component AuthFooter', () => {
expect(wrapper.findComponent({ name: 'AuthFooter' }).exists()).toBe(true)
})
it('has Component AuthNavbar', () => {
expect(wrapper.findComponent({ name: 'AuthNavbar' }).exists()).toBe(true)
})
it('has no sidebar', () => {
expect(wrapper.find('nav#sidenav-main').exists()).not.toBeTruthy()
})
it('has Component AuthCarousel', () => {
expect(wrapper.findComponent({ name: 'AuthCarousel' }).exists()).toBe(true)
})
it('has LanguageSwitch', () => {
expect(wrapper.findComponent({ name: 'LanguageSwitch' }).exists()).toBeTruthy()
})
it('has Component AuthFooter', () => {
expect(wrapper.findComponent({ name: 'AuthFooter' }).exists()).toBe(true)
})
test('test size in setTextSize ', () => {
wrapper.vm.setTextSize('85')
expect(wrapper.vm.$refs.pageFontSize.style.fontSize).toBe('85rem')
it('has no sidebar', () => {
expect(wrapper.find('nav#sidenav-main').exists()).not.toBeTruthy()
})
it('has LanguageSwitch', () => {
expect(wrapper.findComponent({ name: 'LanguageSwitch' }).exists()).toBeTruthy()
})
test('test size in setTextSize ', () => {
wrapper.vm.setTextSize('85')
expect(wrapper.vm.$refs.pageFontSize.style.fontSize).toBe('85rem')
})
})
})
})