Skip to content

Commit

Permalink
Add empty authentication module
Browse files Browse the repository at this point in the history
New versions of vuex warn if there are modules that are used in an
element that haven't had their namespace defined.  This module isn't
actually used in the test, so add an empty Vuex module that matches the
name of AuthenticationStore, so the test can pass.

Change-Id: I5bceb3e1e0bad603028cfb17fa95b020d68ceb4d
Signed-off-by: Ed Tanous <[email protected]>
  • Loading branch information
edtanous authored and sivaprabug committed Mar 1, 2024
1 parent 2f7f657 commit 665235c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/unit/AppHeader.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,15 @@ describe('AppHeader.vue', () => {
'global/getSystemInfo': jest.fn(),
};

const store = new Vuex.Store({ actions });
// VueX requires that all modules be present, even if they aren't used
// in the test, so invent a Fake auth module and install it.
const modules = {
authentication: {
namespaced: true,
},
};

const store = new Vuex.Store({ actions, modules });
const wrapper = mount(AppHeader, {
store,
localVue,
Expand Down

0 comments on commit 665235c

Please sign in to comment.