test watch function for visible

This commit is contained in:
ogerly 2021-12-11 10:27:47 +01:00
parent b7a1b2da69
commit 2cf7de2e4b

View File

@ -1,4 +1,4 @@
import { mount } from '@vue/test-utils'
import { mount, shallowMount } from '@vue/test-utils'
import Navbar from './Navbar'
const localVue = global.localVue
@ -81,4 +81,23 @@ describe('Navbar', () => {
})
})
})
describe('check watch visible true', () => {
beforeEach(async () => {
await wrapper.setProps({ visible: true })
})
it('has visibleCollapse == visible', async () => {
expect(wrapper.vm.visibleCollapse).toBe(true)
})
})
describe('check watch visible false', () => {
beforeEach(async () => {
await wrapper.setProps({ visible: false })
})
it('has visibleCollapse == visible', async () => {
expect(wrapper.vm.visibleCollapse).toBe(false)
})
})
})