From 0f4e6e8e53128e6a9e7c51a2c9c07a43cf1f994e Mon Sep 17 00:00:00 2001 From: andrewbeng89 Date: Mon, 28 Sep 2020 17:17:16 +0800 Subject: [PATCH] test(#45): export factory for new store with exposed done/undone stacks --- tests/store/index.ts | 33 ++++++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/tests/store/index.ts b/tests/store/index.ts index 61ecfe4..a64c92e 100644 --- a/tests/store/index.ts +++ b/tests/store/index.ts @@ -8,16 +8,15 @@ Vue.use(Vuex); const debug = process.env.NODE_ENV !== "production"; +const listUndoRedoConfig = { + namespace: "list", + ignoreMutations: ["addShadow", "removeShadow"] +}; + export const store = { plugins: [ undoRedo({ - paths: [ - { - namespace: "list", - ignoreMutations: ["addShadow", "removeShadow"], - exposeUndoRedoConfig: true - } - ] + paths: [listUndoRedoConfig] }) ], modules: { @@ -27,6 +26,26 @@ export const store = { strict: debug }; +export const getExposedConfigStore = () => { + return new Vuex.Store({ + plugins: [ + undoRedo({ + paths: [ + { + ...listUndoRedoConfig, + exposeUndoRedoConfig: true + } + ] + }) + ], + modules: { + list, + auth + }, + strict: false + }) +}; + export default new Vuex.Store({ ...store, strict: false