remove community to store tests

This commit is contained in:
Ulf Gebhardt 2022-04-20 13:38:56 +02:00
parent 5361cc9eb9
commit 90f0b532e1
Signed by: ulfgebhardt
GPG Key ID: DA6B843E748679C9
4 changed files with 7 additions and 74 deletions

View File

@ -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', () => {

View File

@ -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()
})

View File

@ -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()
})

View File

@ -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 }