From 553710ba6a054959e196cf65f1d46f923e06255d Mon Sep 17 00:00:00 2001 From: Moriz Wahl Date: Wed, 11 Jan 2023 22:26:43 +0100 Subject: [PATCH] remove creations from user frontend --- frontend/src/graphql/mutations.js | 1 - frontend/src/store/store.js | 6 ------ frontend/src/store/store.test.js | 32 ++++++------------------------- 3 files changed, 6 insertions(+), 33 deletions(-) diff --git a/frontend/src/graphql/mutations.js b/frontend/src/graphql/mutations.js index 95d7b0c39..111eb7ab5 100644 --- a/frontend/src/graphql/mutations.js +++ b/frontend/src/graphql/mutations.js @@ -154,7 +154,6 @@ export const login = gql` hasElopage publisherId isAdmin - creation hideAmountGDD hideAmountGDT } diff --git a/frontend/src/store/store.js b/frontend/src/store/store.js index 84fd82fd5..1cd874c06 100644 --- a/frontend/src/store/store.js +++ b/frontend/src/store/store.js @@ -47,9 +47,6 @@ export const mutations = { hasElopage: (state, hasElopage) => { state.hasElopage = hasElopage }, - creation: (state, creation) => { - state.creation = creation - }, hideAmountGDD: (state, hideAmountGDD) => { state.hideAmountGDD = !!hideAmountGDD }, @@ -69,7 +66,6 @@ export const actions = { commit('hasElopage', data.hasElopage) commit('publisherId', data.publisherId) commit('isAdmin', data.isAdmin) - commit('creation', data.creation) commit('hideAmountGDD', data.hideAmountGDD) commit('hideAmountGDT', data.hideAmountGDT) }, @@ -83,7 +79,6 @@ export const actions = { commit('hasElopage', false) commit('publisherId', null) commit('isAdmin', false) - commit('creation', null) commit('hideAmountGDD', false) commit('hideAmountGDT', true) localStorage.clear() @@ -111,7 +106,6 @@ try { newsletterState: null, hasElopage: false, publisherId: null, - creation: null, hideAmountGDD: null, hideAmountGDT: null, }, diff --git a/frontend/src/store/store.test.js b/frontend/src/store/store.test.js index 5f40d7fa2..33fedd562 100644 --- a/frontend/src/store/store.test.js +++ b/frontend/src/store/store.test.js @@ -30,7 +30,6 @@ const { publisherId, isAdmin, hasElopage, - creation, hideAmountGDD, hideAmountGDT, } = mutations @@ -143,14 +142,6 @@ describe('Vuex store', () => { }) }) - describe('creation', () => { - it('sets the state of creation', () => { - const state = { creation: null } - creation(state, true) - expect(state.creation).toEqual(true) - }) - }) - describe('hideAmountGDD', () => { it('sets the state of hideAmountGDD', () => { const state = { hideAmountGDD: false } @@ -183,14 +174,13 @@ describe('Vuex store', () => { hasElopage: false, publisherId: 1234, isAdmin: true, - creation: ['1000', '1000', '1000'], hideAmountGDD: false, hideAmountGDT: true, } it('calls eleven commits', () => { login({ commit, state }, commitedData) - expect(commit).toHaveBeenCalledTimes(11) + expect(commit).toHaveBeenCalledTimes(10) }) it('commits email', () => { @@ -233,19 +223,14 @@ describe('Vuex store', () => { expect(commit).toHaveBeenNthCalledWith(8, 'isAdmin', true) }) - it('commits creation', () => { - login({ commit, state }, commitedData) - expect(commit).toHaveBeenNthCalledWith(9, 'creation', ['1000', '1000', '1000']) - }) - it('commits hideAmountGDD', () => { login({ commit, state }, commitedData) - expect(commit).toHaveBeenNthCalledWith(10, 'hideAmountGDD', false) + expect(commit).toHaveBeenNthCalledWith(9, 'hideAmountGDD', false) }) it('commits hideAmountGDT', () => { login({ commit, state }, commitedData) - expect(commit).toHaveBeenNthCalledWith(11, 'hideAmountGDT', true) + expect(commit).toHaveBeenNthCalledWith(10, 'hideAmountGDT', true) }) }) @@ -255,7 +240,7 @@ describe('Vuex store', () => { it('calls eleven commits', () => { logout({ commit, state }) - expect(commit).toHaveBeenCalledTimes(11) + expect(commit).toHaveBeenCalledTimes(10) }) it('commits token', () => { @@ -298,19 +283,14 @@ describe('Vuex store', () => { expect(commit).toHaveBeenNthCalledWith(8, 'isAdmin', false) }) - it('commits creation', () => { - logout({ commit, state }) - expect(commit).toHaveBeenNthCalledWith(9, 'creation', null) - }) - it('commits hideAmountGDD', () => { logout({ commit, state }) - expect(commit).toHaveBeenNthCalledWith(10, 'hideAmountGDD', false) + expect(commit).toHaveBeenNthCalledWith(9, 'hideAmountGDD', false) }) it('commits hideAmountGDT', () => { logout({ commit, state }) - expect(commit).toHaveBeenNthCalledWith(11, 'hideAmountGDT', true) + expect(commit).toHaveBeenNthCalledWith(10, 'hideAmountGDT', true) }) // how to get this working? it.skip('calls localStorage.clear()', () => {