From fc799a78ebb25ad97d3b449aa49ac08f8bb3bf42 Mon Sep 17 00:00:00 2001 From: ogerly Date: Thu, 2 Dec 2021 09:19:35 +0100 Subject: [PATCH] test von store commit publisherId, test store isAdmin --- frontend/src/store/store.test.js | 10 ++++++++++ frontend/src/views/Pages/Register.spec.js | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/frontend/src/store/store.test.js b/frontend/src/store/store.test.js index 829678b44..051c16102 100644 --- a/frontend/src/store/store.test.js +++ b/frontend/src/store/store.test.js @@ -11,6 +11,7 @@ const { coinanimation, newsletterState, publisherId, + isAdmin, community, hasElopage, } = mutations @@ -104,6 +105,15 @@ describe('Vuex store', () => { }) }) + + describe('isAdmin', () => { + it('sets the state of isAdmin', () => { + const state = { isAdmin: null } + isAdmin(state, true) + expect(state.isAdmin).toEqual(true) + }) + }) + describe('community', () => { it('sets the state of community', () => { const state = {} diff --git a/frontend/src/views/Pages/Register.spec.js b/frontend/src/views/Pages/Register.spec.js index ed4908d86..d6814bd49 100644 --- a/frontend/src/views/Pages/Register.spec.js +++ b/frontend/src/views/Pages/Register.spec.js @@ -229,8 +229,8 @@ describe('Register', () => { wrapper.find('#publisherid').setValue('12345') }) - it('commits openCreationsMinus to store', () => { - expect(storeCommitMock).toBeCalledWith('publisherId', 12345) + it('commits publisherId to store', () => { + expect(mockStoreCommit).toBeCalledWith('publisherId', 12345) }) it('has enabled submit button when completely filled', () => {