summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Tanous <ed@tanous.net>2024-02-27 23:11:59 +0300
committerSivaprabu Ganesan <sivaprabug@ami.com>2024-03-01 16:16:25 +0300
commit665235c663afda9afb8c454ecb8c340af253af9e (patch)
treeb0a4a4346fc9d8b7953ad0f3f1afa305793d737f
parent2f7f657d85990cc0f6ba922f043d7dc13f3dd2e7 (diff)
downloadwebui-vue-665235c663afda9afb8c454ecb8c340af253af9e.tar.xz
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 <ed@tanous.net>
-rw-r--r--tests/unit/AppHeader.spec.js10
1 files changed, 9 insertions, 1 deletions
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,