blob: 3424f69828ceca66f4d36c7dfc4f1f59067f5b27 [file] [log] [blame]
Sukanya Pandey98059c92020-03-26 17:10:32 +05301import { mount } from '@vue/test-utils';
2import AppNavigation from '@/components/AppNavigation';
3import Vue from 'vue';
4import { BootstrapVue } from 'bootstrap-vue';
5
6describe('AppNavigation.vue', () => {
7 let wrapper;
8 Vue.use(BootstrapVue);
9
10 wrapper = mount(AppNavigation, {
11 mocks: {
12 $t: key => key
13 }
14 });
15
16 describe('Component exists', () => {
17 it('should check if AppNavigation exists', async () => {
18 expect(wrapper.exists());
19 });
20 });
21
22 describe('Methods', () => {
23 describe('toggleIsOpen method', () => {
24 it('should call toggleIsOpen and toggle isNavigationOpen to false', async () => {
25 wrapper.vm.isNavigationOpen = true;
26 wrapper.vm.toggleIsOpen();
27 expect(wrapper.vm.isNavigationOpen).to.be.false;
28 });
29
30 it('should call toggleIsOpen and toggle isNavigationOpen to true', async () => {
31 wrapper.vm.isNavigationOpen = false;
32 wrapper.vm.toggleIsOpen();
33 expect(wrapper.vm.isNavigationOpen).to.be.true;
34 });
35 });
36 });
37});