From 90f0b532e14293df1a47f5ee0b31e5e6c3fe1a7e Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Wed, 20 Apr 2022 13:38:56 +0200 Subject: [PATCH] remove community to store tests --- frontend/src/pages/Login.spec.js | 40 ++++---------------- frontend/src/pages/Register.spec.js | 13 ------- frontend/src/pages/RegisterCommunity.spec.js | 9 ----- frontend/src/store/store.test.js | 19 ---------- 4 files changed, 7 insertions(+), 74 deletions(-) diff --git a/frontend/src/pages/Login.spec.js b/frontend/src/pages/Login.spec.js index e506794b3..c706b0895 100644 --- a/frontend/src/pages/Login.spec.js +++ b/frontend/src/pages/Login.spec.js @@ -29,10 +29,6 @@ describe('Login', () => { dispatch: mockStoreDispach, commit: mockStoreCommit, state: { - community: { - name: '', - description: '', - }, publisherId: 12345, }, }, @@ -60,15 +56,6 @@ describe('Login', () => { wrapper = Wrapper() }) - it('commits the community info to the store', () => { - expect(mockStoreCommit).toBeCalledWith('community', { - name: 'test12', - description: 'test community 12', - url: 'http://test12.test12/', - registerUrl: 'http://test12.test12/register', - }) - }) - it('renders the Login form', () => { expect(wrapper.find('div.login-form').exists()).toBeTruthy() }) @@ -79,27 +66,14 @@ describe('Login', () => { }) }) - describe('Community data already loaded', () => { - beforeEach(() => { - jest.clearAllMocks() - mocks.$store.state.community = { - name: 'Gradido Entwicklung', - url: 'http://localhost/', - registerUrl: 'http://localhost/register', - description: 'Die lokale Entwicklungsumgebung von Gradido.', - } - wrapper = Wrapper() - }) + it('has a Community name', () => { + expect(wrapper.find('.test-communitydata b').text()).toBe('Gradido Entwicklung') + }) - it('has a Community name', () => { - expect(wrapper.find('.test-communitydata b').text()).toBe('Gradido Entwicklung') - }) - - it('has a Community description', () => { - expect(wrapper.find('.test-communitydata p').text()).toBe( - 'Die lokale Entwicklungsumgebung von Gradido.', - ) - }) + it('has a Community description', () => { + expect(wrapper.find('.test-communitydata p').text()).toBe( + 'Die lokale Entwicklungsumgebung von Gradido.', + ) }) describe('links', () => { diff --git a/frontend/src/pages/Register.spec.js b/frontend/src/pages/Register.spec.js index b4f518d3c..1e791f7d4 100644 --- a/frontend/src/pages/Register.spec.js +++ b/frontend/src/pages/Register.spec.js @@ -30,10 +30,6 @@ describe('Register', () => { state: { email: 'peter@lustig.de', language: 'en', - community: { - name: '', - description: '', - }, publisherId: 12345, }, }, @@ -52,15 +48,6 @@ describe('Register', () => { wrapper = Wrapper() }) - it('commits the community info to the store', () => { - expect(mockStoreCommit).toBeCalledWith('community', { - name: 'test12', - description: 'test community 12', - url: 'http://test12.test12/', - registerUrl: 'http://test12.test12/register', - }) - }) - it('renders the Register form', () => { expect(wrapper.find('div#registerform').exists()).toBeTruthy() }) diff --git a/frontend/src/pages/RegisterCommunity.spec.js b/frontend/src/pages/RegisterCommunity.spec.js index 76890f877..05f9014f4 100644 --- a/frontend/src/pages/RegisterCommunity.spec.js +++ b/frontend/src/pages/RegisterCommunity.spec.js @@ -37,15 +37,6 @@ describe('RegisterCommunity', () => { wrapper = Wrapper() }) - it('commits the community info to the store', () => { - expect(mockStoreCommit).toBeCalledWith('community', { - name: 'test12', - description: 'test community 12', - url: 'http://test12.test12/', - registerUrl: 'http://test12.test12/register', - }) - }) - it('renders the Div Element "#register-community"', () => { expect(wrapper.find('div#register-community').exists()).toBeTruthy() }) diff --git a/frontend/src/store/store.test.js b/frontend/src/store/store.test.js index ea40d9474..9eadedd6b 100644 --- a/frontend/src/store/store.test.js +++ b/frontend/src/store/store.test.js @@ -24,7 +24,6 @@ const { newsletterState, publisherId, isAdmin, - community, hasElopage, } = mutations const { login, logout } = actions @@ -117,24 +116,6 @@ describe('Vuex store', () => { }) }) - describe('community', () => { - it('sets the state of community', () => { - const state = {} - community(state, { - name: 'test12', - description: 'test community 12', - url: 'http://test12.test12/', - registerUrl: 'http://test12.test12/register', - }) - expect(state.community).toEqual({ - name: 'test12', - description: 'test community 12', - url: 'http://test12.test12/', - registerUrl: 'http://test12.test12/register', - }) - }) - }) - describe('hasElopage', () => { it('sets the state of hasElopage', () => { const state = { hasElopage: false }