summaryrefslogtreecommitdiff
path: root/tests/unit/AppNavigation.spec.js
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/AppNavigation.spec.js')
-rw-r--r--tests/unit/AppNavigation.spec.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/tests/unit/AppNavigation.spec.js b/tests/unit/AppNavigation.spec.js
new file mode 100644
index 00000000..3424f698
--- /dev/null
+++ b/tests/unit/AppNavigation.spec.js
@@ -0,0 +1,37 @@
+import { mount } from '@vue/test-utils';
+import AppNavigation from '@/components/AppNavigation';
+import Vue from 'vue';
+import { BootstrapVue } from 'bootstrap-vue';
+
+describe('AppNavigation.vue', () => {
+ let wrapper;
+ Vue.use(BootstrapVue);
+
+ wrapper = mount(AppNavigation, {
+ mocks: {
+ $t: key => key
+ }
+ });
+
+ describe('Component exists', () => {
+ it('should check if AppNavigation exists', async () => {
+ expect(wrapper.exists());
+ });
+ });
+
+ describe('Methods', () => {
+ describe('toggleIsOpen method', () => {
+ it('should call toggleIsOpen and toggle isNavigationOpen to false', async () => {
+ wrapper.vm.isNavigationOpen = true;
+ wrapper.vm.toggleIsOpen();
+ expect(wrapper.vm.isNavigationOpen).to.be.false;
+ });
+
+ it('should call toggleIsOpen and toggle isNavigationOpen to true', async () => {
+ wrapper.vm.isNavigationOpen = false;
+ wrapper.vm.toggleIsOpen();
+ expect(wrapper.vm.isNavigationOpen).to.be.true;
+ });
+ });
+ });
+});