diff --git a/deployment/bare_metal/.env.dist b/deployment/bare_metal/.env.dist index 4c6e956af..efac0fc68 100644 --- a/deployment/bare_metal/.env.dist +++ b/deployment/bare_metal/.env.dist @@ -17,6 +17,12 @@ NGINX_UPDATE_PAGE_ROOT=/home/gradido/gradido/deployment/bare_metal/nginx/update- WEBHOOK_GITHUB_SECRET=secret WEBHOOK_GITHUB_BRANCH=master +# community +COMMUNITY_NAME="Gradido Development Stage1" +COMMUNITY_URL=https://stage1.gradido.net/ +COMMUNITY_REGISTER_URL=https://stage1.gradido.net/register +COMMUNITY_DESCRIPTION="Gradido Development Stage1 Test Community" + # backend BACKEND_CONFIG_VERSION=v5.2022-04-12 @@ -31,11 +37,6 @@ KLICKTIPP_PASSWORD= KLICKTIPP_APIKEY_DE= KLICKTIPP_APIKEY_EN= -COMMUNITY_NAME="Gradido Development Stage1" -COMMUNITY_URL=https://stage1.gradido.net/ -COMMUNITY_REGISTER_URL=https://stage1.gradido.net/register -COMMUNITY_DESCRIPTION="Gradido Development Stage1 Test Community" - EMAIL=true EMAIL_USERNAME=peter@lustig.de EMAIL_SENDER=peter@lustig.de @@ -54,7 +55,7 @@ WEBHOOK_ELOPAGE_SECRET=secret DATABASE_CONFIG_VERSION=v1.2022-03-18 # frontend -FRONTEND_CONFIG_VERSION=v1.2022-03-18 +FRONTEND_CONFIG_VERSION=v2.2022-04-07 GRAPHQL_URI=https://stage1.gradido.net/graphql ADMIN_AUTH_URL=https://stage1.gradido.net/admin/authenticate?token={token} diff --git a/frontend/.env.dist b/frontend/.env.dist index df3c7cd7e..65d9ae305 100644 --- a/frontend/.env.dist +++ b/frontend/.env.dist @@ -1,5 +1,19 @@ -CONFIG_VERSION=v1.2022-03-18 +CONFIG_VERSION=v2.2022-04-07 +# Environment +DEFAULT_PUBLISHER_ID=2896 + +# Endpoints +GRAPHQL_URI=http://localhost/graphql +ADMIN_AUTH_URL=http://localhost/admin/authenticate?token={token} + +# Community +COMMUNITY_NAME=Gradido Entwicklung +COMMUNITY_URL=http://localhost/ +COMMUNITY_REGISTER_URL=http://localhost/register +COMMUNITY_DESCRIPTION=Die lokale Entwicklungsumgebung von Gradido. + +# Meta META_URL=http://localhost META_TITLE_DE="Gradido – Dein Dankbarkeitskonto" META_TITLE_EN="Gradido - Your gratitude account" @@ -7,7 +21,4 @@ META_DESCRIPTION_DE="Dankbarkeit ist die Währung der neuen Zeit. Immer mehr Men META_DESCRIPTION_EN="Gratitude is the currency of the new age. More and more people are unleashing their potential and shaping a good future for all." META_KEYWORDS_DE="Grundeinkommen, Währung, Dankbarkeit, Schenk-Ökonomie, Natürliche Ökonomie des Lebens, Ökonomie, Ökologie, Potenzialentfaltung, Schenken und Danken, Kreislauf des Lebens, Geldsystem" META_KEYWORDS_EN="Basic Income, Currency, Gratitude, Gift Economy, Natural Economy of Life, Economy, Ecology, Potential Development, Giving and Thanking, Cycle of Life, Monetary System" -META_AUTHOR="Bernd Hückstädt - Gradido-Akademie" -GRAPHQL_URI=http://localhost/graphql -DEFAULT_PUBLISHER_ID=2896 -ADMIN_AUTH_URL=http://localhost/admin/authenticate?token={token} \ No newline at end of file +META_AUTHOR="Bernd Hückstädt - Gradido-Akademie" \ No newline at end of file diff --git a/frontend/.env.template b/frontend/.env.template index 10c42daa9..6d6b83fc7 100644 --- a/frontend/.env.template +++ b/frontend/.env.template @@ -1,5 +1,19 @@ CONFIG_VERSION=$FRONTEND_CONFIG_VERSION +# Environment +DEFAULT_PUBLISHER_ID=$DEFAULT_PUBLISHER_ID + +# Endpoints +GRAPHQL_URI=$GRAPHQL_URI +ADMIN_AUTH_URL=$ADMIN_AUTH_URL + +# Community +COMMUNITY_NAME=$COMMUNITY_NAME +COMMUNITY_URL=$COMMUNITY_URL +COMMUNITY_REGISTER_URL=$COMMUNITY_REGISTER_URL +COMMUNITY_DESCRIPTION=$COMMUNITY_DESCRIPTION + +# Meta META_URL=$META_URL META_TITLE_DE=$META_TITLE_DE META_TITLE_EN=$META_TITLE_EN @@ -7,7 +21,4 @@ META_DESCRIPTION_DE=$META_DESCRIPTION_DE META_DESCRIPTION_EN=$META_DESCRIPTION_EN META_KEYWORDS_DE=$META_KEYWORDS_DE META_KEYWORDS_EN=$META_KEYWORDS_EN -META_AUTHOR=$META_AUTHOR -GRAPHQL_URI=$GRAPHQL_URI -DEFAULT_PUBLISHER_ID=$DEFAULT_PUBLISHER_ID -ADMIN_AUTH_URL=$ADMIN_AUTH_URL \ No newline at end of file +META_AUTHOR=$META_AUTHOR \ No newline at end of file diff --git a/frontend/src/config/index.js b/frontend/src/config/index.js index a11b5d924..917a25d70 100644 --- a/frontend/src/config/index.js +++ b/frontend/src/config/index.js @@ -8,7 +8,7 @@ const constants = { DECAY_START_TIME: new Date('2021-05-13 17:46:31-0000'), // GMT+0 CONFIG_VERSION: { DEFAULT: 'DEFAULT', - EXPECTED: 'v1.2022-03-18', + EXPECTED: 'v2.2022-04-07', CURRENT: '', }, } @@ -28,6 +28,19 @@ const environment = { PORT: process.env.PORT || 3000, } +const endpoints = { + GRAPHQL_URI: process.env.GRAPHQL_URI || 'http://localhost/graphql', + ADMIN_AUTH_URL: process.env.ADMIN_AUTH_URL || 'http://localhost/admin/authenticate?token={token}', +} + +const community = { + COMMUNITY_NAME: process.env.COMMUNITY_NAME || 'Gradido Entwicklung', + COMMUNITY_URL: process.env.COMMUNITY_URL || 'http://localhost/', + COMMUNITY_REGISTER_URL: process.env.COMMUNITY_REGISTER_URL || 'http://localhost/register', + COMMUNITY_DESCRIPTION: + process.env.COMMUNITY_DESCRIPTION || 'Die lokale Entwicklungsumgebung von Gradido.', +} + const meta = { META_URL: process.env.META_URL || 'http://localhost', META_TITLE_DE: process.env.META_TITLE_DE || 'Gradido – Dein Dankbarkeitskonto', @@ -47,11 +60,6 @@ const meta = { META_AUTHOR: process.env.META_AUTHOR || 'Bernd Hückstädt - Gradido-Akademie', } -const endpoints = { - GRAPHQL_URI: process.env.GRAPHQL_URI || 'http://localhost/graphql', - ADMIN_AUTH_URL: process.env.ADMIN_AUTH_URL || 'http://localhost/admin/authenticate?token={token}', -} - // Check config version constants.CONFIG_VERSION.CURRENT = process.env.CONFIG_VERSION || constants.CONFIG_VERSION.DEFAULT if ( @@ -69,6 +77,7 @@ const CONFIG = { ...version, ...environment, ...endpoints, + ...community, ...meta, } diff --git a/frontend/src/graphql/queries.js b/frontend/src/graphql/queries.js index 6a27a8052..3d5a6a95c 100644 --- a/frontend/src/graphql/queries.js +++ b/frontend/src/graphql/queries.js @@ -95,17 +95,6 @@ export const listGDTEntriesQuery = gql` } ` -export const communityInfo = gql` - query { - getCommunityInfo { - name - description - registerUrl - url - } - } -` - export const communities = gql` query { communities { diff --git a/frontend/src/mixins/getCommunityInfo.js b/frontend/src/mixins/getCommunityInfo.js deleted file mode 100644 index c6c021f9c..000000000 --- a/frontend/src/mixins/getCommunityInfo.js +++ /dev/null @@ -1,24 +0,0 @@ -import { communityInfo } from '../graphql/queries' - -export const getCommunityInfoMixin = { - methods: { - getCommunityInfo() { - if (this.$store.state.community.name === '') { - this.$apollo - .query({ - query: communityInfo, - }) - .then((result) => { - this.$store.commit('community', result.data.getCommunityInfo) - return result.data.getCommunityInfo - }) - .catch((error) => { - this.toastError(error.message) - }) - } - }, - }, - created() { - this.getCommunityInfo() - }, -} diff --git a/frontend/src/pages/Login.spec.js b/frontend/src/pages/Login.spec.js index e26888d49..abe3415c6 100644 --- a/frontend/src/pages/Login.spec.js +++ b/frontend/src/pages/Login.spec.js @@ -6,17 +6,7 @@ import { toastErrorSpy } from '@test/testSetup' const localVue = global.localVue -const apolloQueryMock = jest.fn().mockResolvedValue({ - data: { - getCommunityInfo: { - name: 'test12', - description: 'test community 12', - url: 'http://test12.test12/', - registerUrl: 'http://test12.test12/register', - }, - }, -}) - +const apolloQueryMock = jest.fn() const mockStoreDispach = jest.fn() const mockStoreCommit = jest.fn() const mockRouterPush = jest.fn() @@ -39,10 +29,6 @@ describe('Login', () => { dispatch: mockStoreDispach, commit: mockStoreCommit, state: { - community: { - name: '', - description: '', - }, publisherId: 12345, }, }, @@ -73,63 +59,24 @@ 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() }) - describe('communities gives back error', () => { - beforeEach(() => { - apolloQueryMock.mockRejectedValue({ - message: 'Failed to get communities', - }) - wrapper = Wrapper() - }) - - it('toasts an error message', () => { - expect(toastErrorSpy).toBeCalledWith('Failed to get communities') - }) - }) - describe('Login header', () => { it('has a welcome message', () => { expect(wrapper.find('div.header').text()).toBe('site.login.heading site.login.community') }) }) - 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('does not call community data update', () => { - expect(apolloQueryMock).not.toBeCalled() - }) + it('has a Community description', () => { + expect(wrapper.find('.test-communitydata p').text()).toBe( + 'Die lokale Entwicklungsumgebung von Gradido.', + ) }) describe('links', () => { @@ -197,13 +144,13 @@ describe('Login', () => { await wrapper.find('input[placeholder="Email"]').setValue('user@example.org') await wrapper.find('input[placeholder="form.password"]').setValue('1234') await flushPromises() - await wrapper.find('form').trigger('submit') - await flushPromises() apolloQueryMock.mockResolvedValue({ data: { login: 'token', }, }) + await wrapper.find('form').trigger('submit') + await flushPromises() }) it('calls the API with the given data', () => { @@ -255,58 +202,64 @@ describe('Login', () => { }) }) }) + }) - describe('login fails', () => { - beforeEach(() => { + describe('login fails', () => { + beforeEach(async () => { + jest.clearAllMocks() + await wrapper.find('input[placeholder="Email"]').setValue('user@example.org') + await wrapper.find('input[placeholder="form.password"]').setValue('1234') + await flushPromises() + apolloQueryMock.mockRejectedValue({ + message: '..No user with this credentials', + }) + await wrapper.find('form').trigger('submit') + await flushPromises() + }) + + it('hides the spinner', () => { + expect(spinnerHideMock).toBeCalled() + }) + + it('toasts an error message', () => { + expect(toastErrorSpy).toBeCalledWith('error.no-account') + }) + + describe('login fails with "User email not validated"', () => { + beforeEach(async () => { apolloQueryMock.mockRejectedValue({ - message: '..No user with this credentials', + message: 'User email not validated', }) + wrapper = Wrapper() + jest.clearAllMocks() + await wrapper.find('input[placeholder="Email"]').setValue('user@example.org') + await wrapper.find('input[placeholder="form.password"]').setValue('1234') + await flushPromises() + await wrapper.find('form').trigger('submit') + await flushPromises() }) - it('hides the spinner', () => { - expect(spinnerHideMock).toBeCalled() + it('redirects to /thx/login', () => { + expect(mockRouterPush).toBeCalledWith('/thx/login') + }) + }) + + describe('login fails with "User has no password set yet"', () => { + beforeEach(async () => { + apolloQueryMock.mockRejectedValue({ + message: 'User has no password set yet', + }) + wrapper = Wrapper() + jest.clearAllMocks() + await wrapper.find('input[placeholder="Email"]').setValue('user@example.org') + await wrapper.find('input[placeholder="form.password"]').setValue('1234') + await flushPromises() + await wrapper.find('form').trigger('submit') + await flushPromises() }) - it('toasts an error message', () => { - expect(toastErrorSpy).toBeCalledWith('error.no-account') - }) - - describe('login fails with "User email not validated"', () => { - beforeEach(async () => { - apolloQueryMock.mockRejectedValue({ - message: 'User email not validated', - }) - wrapper = Wrapper() - jest.clearAllMocks() - await wrapper.find('input[placeholder="Email"]').setValue('user@example.org') - await wrapper.find('input[placeholder="form.password"]').setValue('1234') - await flushPromises() - await wrapper.find('form').trigger('submit') - await flushPromises() - }) - - it('redirects to /thx/login', () => { - expect(mockRouterPush).toBeCalledWith('/thx/login') - }) - }) - - describe('login fails with "User has no password set yet"', () => { - beforeEach(async () => { - apolloQueryMock.mockRejectedValue({ - message: 'User has no password set yet', - }) - wrapper = Wrapper() - jest.clearAllMocks() - await wrapper.find('input[placeholder="Email"]').setValue('user@example.org') - await wrapper.find('input[placeholder="form.password"]').setValue('1234') - await flushPromises() - await wrapper.find('form').trigger('submit') - await flushPromises() - }) - - it('redirects to /reset-password/login', () => { - expect(mockRouterPush).toBeCalledWith('/reset-password/login') - }) + it('redirects to /reset-password/login', () => { + expect(mockRouterPush).toBeCalledWith('/reset-password/login') }) }) }) diff --git a/frontend/src/pages/Login.vue b/frontend/src/pages/Login.vue index 79532cb21..f01332202 100755 --- a/frontend/src/pages/Login.vue +++ b/frontend/src/pages/Login.vue @@ -19,9 +19,9 @@
- {{ $store.state.community.name }} + {{ CONFIG.COMMUNITY_NAME }}

- {{ $store.state.community.description }} + {{ CONFIG.COMMUNITY_DESCRIPTION }}

{{ $t('login') }}
@@ -63,7 +63,7 @@ import InputPassword from '@/components/Inputs/InputPassword' import InputEmail from '@/components/Inputs/InputEmail' import { login } from '@/graphql/queries' -import { getCommunityInfoMixin } from '@/mixins/getCommunityInfo' +import CONFIG from '@/config' export default { name: 'Login', @@ -71,7 +71,6 @@ export default { InputPassword, InputEmail, }, - mixins: [getCommunityInfoMixin], data() { return { form: { @@ -79,6 +78,7 @@ export default { password: '', }, passwordVisible: false, + CONFIG, } }, methods: { diff --git a/frontend/src/pages/Register.spec.js b/frontend/src/pages/Register.spec.js index 446c97928..1e791f7d4 100644 --- a/frontend/src/pages/Register.spec.js +++ b/frontend/src/pages/Register.spec.js @@ -2,21 +2,8 @@ import { mount, RouterLinkStub } from '@vue/test-utils' import flushPromises from 'flush-promises' import Register from './Register' -import { toastErrorSpy } from '@test/testSetup' - const localVue = global.localVue -const apolloQueryMock = jest.fn().mockResolvedValue({ - data: { - getCommunityInfo: { - name: 'test12', - description: 'test community 12', - url: 'http://test12.test12/', - registerUrl: 'http://test12.test12/register', - }, - }, -}) - const mockStoreCommit = jest.fn() const registerUserMutationMock = jest.fn() const routerPushMock = jest.fn() @@ -37,17 +24,12 @@ describe('Register', () => { }, $apollo: { mutate: registerUserMutationMock, - query: apolloQueryMock, }, $store: { commit: mockStoreCommit, state: { email: 'peter@lustig.de', language: 'en', - community: { - name: '', - description: '', - }, publisherId: 12345, }, }, @@ -66,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() }) @@ -85,19 +58,6 @@ describe('Register', () => { }) }) - describe('communities gives back error', () => { - beforeEach(() => { - apolloQueryMock.mockRejectedValue({ - message: 'Failed to get communities', - }) - wrapper = Wrapper() - }) - - it('toasts an error message', () => { - expect(toastErrorSpy).toBeCalledWith('Failed to get communities') - }) - }) - describe('Community data already loaded', () => { beforeEach(() => { jest.clearAllMocks() @@ -119,10 +79,6 @@ describe('Register', () => { 'Die lokale Entwicklungsumgebung von Gradido.', ) }) - - it('does not call community data update', () => { - expect(apolloQueryMock).not.toBeCalled() - }) }) describe('links', () => { diff --git a/frontend/src/pages/Register.vue b/frontend/src/pages/Register.vue index cadc0f34c..94441c636 100755 --- a/frontend/src/pages/Register.vue +++ b/frontend/src/pages/Register.vue @@ -23,9 +23,9 @@
- {{ $store.state.community.name }} + {{ CONFIG.COMMUNITY_NAME }}

- {{ $store.state.community.description }} + {{ CONFIG.COMMUNITY_DESCRIPTION }}

{{ $t('signup') }}
@@ -192,12 +192,11 @@ import InputEmail from '@/components/Inputs/InputEmail.vue' import LanguageSwitchSelect from '@/components/LanguageSwitchSelect.vue' import { createUser } from '@/graphql/mutations' -import { getCommunityInfoMixin } from '@/mixins/getCommunityInfo' +import CONFIG from '@/config' export default { components: { InputEmail, LanguageSwitchSelect }, name: 'Register', - mixins: [getCommunityInfoMixin], data() { return { form: { @@ -213,6 +212,7 @@ export default { register: true, publisherId: this.$store.state.publisherId, redeemCode: this.$route.params.code, + CONFIG, } }, methods: { diff --git a/frontend/src/pages/RegisterCommunity.spec.js b/frontend/src/pages/RegisterCommunity.spec.js index deb1d999d..05f9014f4 100644 --- a/frontend/src/pages/RegisterCommunity.spec.js +++ b/frontend/src/pages/RegisterCommunity.spec.js @@ -1,21 +1,8 @@ import { mount, RouterLinkStub } from '@vue/test-utils' import RegisterCommunity from './RegisterCommunity' -import { toastErrorSpy } from '@test/testSetup' - const localVue = global.localVue -const apolloQueryMock = jest.fn().mockResolvedValue({ - data: { - getCommunityInfo: { - name: 'test12', - description: 'test community 12', - url: 'http://test12.test12/', - registerUrl: 'http://test12.test12/register', - }, - }, -}) - const mockStoreCommit = jest.fn() describe('RegisterCommunity', () => { @@ -26,9 +13,6 @@ describe('RegisterCommunity', () => { locale: 'en', }, $t: jest.fn((t) => t), - $apollo: { - query: apolloQueryMock, - }, $store: { commit: mockStoreCommit, state: { @@ -53,32 +37,10 @@ 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() }) - describe('communities gives back error', () => { - beforeEach(() => { - apolloQueryMock.mockRejectedValue({ - message: 'Failed to get communities', - }) - wrapper = Wrapper() - }) - - it('toasts an error message', () => { - expect(toastErrorSpy).toBeCalledWith('Failed to get communities') - }) - }) - describe('Community data already loaded', () => { beforeEach(() => { jest.clearAllMocks() @@ -100,10 +62,6 @@ describe('RegisterCommunity', () => { 'Die lokale Entwicklungsumgebung von Gradido.', ) }) - - it('does not call community data update', () => { - expect(apolloQueryMock).not.toBeCalled() - }) }) describe('buttons and links', () => { diff --git a/frontend/src/pages/RegisterCommunity.vue b/frontend/src/pages/RegisterCommunity.vue index 736a4282f..1acc0827e 100644 --- a/frontend/src/pages/RegisterCommunity.vue +++ b/frontend/src/pages/RegisterCommunity.vue @@ -6,12 +6,12 @@
-

{{ $store.state.community.name }}

+

{{ CONFIG.COMMUNITY_NAME }}

- {{ $store.state.community.description }} + {{ CONFIG.COMMUNITY_DESCRIPTION }}

- {{ $store.state.community.url }} + {{ CONFIG.COMMUNITY_URL }}

@@ -49,10 +49,14 @@
diff --git a/frontend/src/pages/SelectCommunity.spec.js b/frontend/src/pages/SelectCommunity.spec.js index f8896ae15..25ec8db93 100644 --- a/frontend/src/pages/SelectCommunity.spec.js +++ b/frontend/src/pages/SelectCommunity.spec.js @@ -1,5 +1,5 @@ import { mount, RouterLinkStub } from '@vue/test-utils' -import { communities, communityInfo } from '@/graphql/queries' +import { communities } from '@/graphql/queries' import SelectCommunity from './SelectCommunity' import { toastErrorSpy } from '@test/testSetup' @@ -14,45 +14,33 @@ const spinnerMock = jest.fn(() => { } }) -const apolloQueryMock = jest - .fn() - .mockResolvedValueOnce({ - data: { - getCommunityInfo: { - name: 'test12', - description: 'test community 12', - url: 'http://test12.test12/', - registerUrl: 'http://test12.test12/register', +const apolloQueryMock = jest.fn().mockResolvedValue({ + data: { + communities: [ + { + id: 1, + name: 'Gradido Entwicklung', + description: 'Die lokale Entwicklungsumgebung von Gradido.', + url: 'http://localhost/', + registerUrl: 'http://localhost/register-community', }, - }, - }) - .mockResolvedValue({ - data: { - communities: [ - { - id: 1, - name: 'Gradido Entwicklung', - description: 'Die lokale Entwicklungsumgebung von Gradido.', - url: 'http://localhost/', - registerUrl: 'http://localhost/register-community', - }, - { - id: 2, - name: 'Gradido Staging', - description: 'Der Testserver der Gradido-Akademie.', - url: 'https://stage1.gradido.net/', - registerUrl: 'https://stage1.gradido.net/register-community', - }, - { - id: 3, - name: 'Gradido-Akademie', - description: 'Freies Institut für Wirtschaftsbionik.', - url: 'https://gradido.net', - registerUrl: 'https://gdd1.gradido.com/register-community', - }, - ], - }, - }) + { + id: 2, + name: 'Gradido Staging', + description: 'Der Testserver der Gradido-Akademie.', + url: 'https://stage1.gradido.net/', + registerUrl: 'https://stage1.gradido.net/register-community', + }, + { + id: 3, + name: 'Gradido-Akademie', + description: 'Freies Institut für Wirtschaftsbionik.', + url: 'https://gradido.net', + registerUrl: 'https://gdd1.gradido.com/register-community', + }, + ], + }, +}) const mockStoreCommit = jest.fn() @@ -95,12 +83,6 @@ describe('SelectCommunity', () => { wrapper = Wrapper() }) - it('calls the API to get the community info data', () => { - expect(apolloQueryMock).toBeCalledWith({ - query: communityInfo, - }) - }) - it('calls the API to get the communities data', () => { expect(apolloQueryMock).toBeCalledWith({ query: communities, @@ -141,12 +123,6 @@ describe('SelectCommunity', () => { wrapper = Wrapper() }) - it('does not call community info data when already filled', () => { - expect(apolloQueryMock).not.toBeCalledWith({ - query: communityInfo, - }) - }) - it('has a Community name', () => { expect(wrapper.find('.card-body b').text()).toBe('Gradido Entwicklung') }) diff --git a/frontend/src/pages/SelectCommunity.vue b/frontend/src/pages/SelectCommunity.vue index 0535e4fe7..8702d3e2e 100644 --- a/frontend/src/pages/SelectCommunity.vue +++ b/frontend/src/pages/SelectCommunity.vue @@ -5,9 +5,9 @@
- {{ $store.state.community.name }} + {{ CONFIG.COMMUNITY_NAME }}
-

{{ $store.state.community.description }}

+

{{ CONFIG.COMMUNITY_DESCRIPTION }}


@@ -49,7 +49,7 @@