Sukanya Pandey | 98059c9 | 2020-03-26 17:10:32 +0530 | [diff] [blame] | 1 | import { mount } from '@vue/test-utils'; |
| 2 | import AppNavigation from '@/components/AppNavigation'; |
| 3 | import Vue from 'vue'; |
| 4 | import { BootstrapVue } from 'bootstrap-vue'; |
| 5 | |
| 6 | describe('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 | }); |