AppHeader.spec.js (df8cf6ac32b897c5b36c5902c40cad7a2dcad12b) AppHeader.spec.js (665235c663afda9afb8c454ecb8c340af253af9e)
1import { mount, createLocalVue, createWrapper } from '@vue/test-utils';
2import Vue from 'vue';
3import Vuex from 'vuex';
4import AppHeader from '@/components/AppHeader';
5
6// Silencing warnings about undefined Bootsrap-vue components
7Vue.config.silent = true;
8const localVue = createLocalVue();
9localVue.use(Vuex);
10
11describe('AppHeader.vue', () => {
12 const actions = {
13 'global/getServerStatus': jest.fn(),
14 'eventLog/getEventLogData': jest.fn(),
15 'authentication/resetStoreState': jest.fn(),
16 'global/getSystemInfo': jest.fn(),
17 };
18
1import { mount, createLocalVue, createWrapper } from '@vue/test-utils';
2import Vue from 'vue';
3import Vuex from 'vuex';
4import AppHeader from '@/components/AppHeader';
5
6// Silencing warnings about undefined Bootsrap-vue components
7Vue.config.silent = true;
8const localVue = createLocalVue();
9localVue.use(Vuex);
10
11describe('AppHeader.vue', () => {
12 const actions = {
13 'global/getServerStatus': jest.fn(),
14 'eventLog/getEventLogData': jest.fn(),
15 'authentication/resetStoreState': jest.fn(),
16 'global/getSystemInfo': jest.fn(),
17 };
18
19 const store = new Vuex.Store({ actions });
19 // VueX requires that all modules be present, even if they aren't used
20 // in the test, so invent a Fake auth module and install it.
21 const modules = {
22 authentication: {
23 namespaced: true,
24 },
25 };
26
27 const store = new Vuex.Store({ actions, modules });
20 const wrapper = mount(AppHeader, {
21 store,
22 localVue,
23 mocks: {
24 $t: (key) => key,
25 },
26 });
27

--- 52 unchanged lines hidden ---
28 const wrapper = mount(AppHeader, {
29 store,
30 localVue,
31 mocks: {
32 $t: (key) => key,
33 },
34 });
35

--- 52 unchanged lines hidden ---