From 665235c663afda9afb8c454ecb8c340af253af9e Mon Sep 17 00:00:00 2001 From: Ed Tanous Date: Tue, 27 Feb 2024 12:11:59 -0800 Subject: Add empty authentication module 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 --- tests/unit/AppHeader.spec.js | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/unit/AppHeader.spec.js b/tests/unit/AppHeader.spec.js index ed78f033..2d17e768 100644 --- a/tests/unit/AppHeader.spec.js +++ b/tests/unit/AppHeader.spec.js @@ -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, -- cgit v1.2.3