From dde7bb292fd48a9b589213ec59e4d00e9aeb80dd Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 5 Oct 2021 15:19:10 +0200 Subject: [PATCH] first step of review, fix frotend and backend --- backend/src/config/index.ts | 5 ++--- backend/src/graphql/resolver/CommunityResolver.ts | 6 +++--- frontend/src/views/Pages/Login.spec.js | 14 +++++++------- frontend/src/views/Pages/Register.spec.js | 4 ++-- frontend/src/views/Pages/RegisterCommunity.spec.js | 8 +++----- .../views/Pages/RegisterSelectCommunity.spec.js | 5 ++--- 6 files changed, 19 insertions(+), 23 deletions(-) diff --git a/backend/src/config/index.ts b/backend/src/config/index.ts index 424d90185..76ba597ad 100644 --- a/backend/src/config/index.ts +++ b/backend/src/config/index.ts @@ -32,9 +32,8 @@ const klicktipp = { const community = { COMMUNITY_NAME: process.env.COMMUNITY_NAME || 'Gradido Entwicklung', - COMMUNITY_URL: process.env.COMMUNITY_URL || 'http://localhost:3000/vue/', - COMMUNITY_REGISTER_URL: - process.env.COMMUNITY_REGISTER_URL || 'http://localhost:3000/vue/register', + COMMUNITY_URL: process.env.COMMUNITY_URL || 'http://localhost/vue/', + COMMUNITY_REGISTER_URL: process.env.COMMUNITY_REGISTER_URL || 'http://localhost/vue/register', COMMUNITY_DESCRIPTION: process.env.COMMUNITY_DESCRIPTION || 'Die lokale Entwicklungsumgebung von Gradido.', } diff --git a/backend/src/graphql/resolver/CommunityResolver.ts b/backend/src/graphql/resolver/CommunityResolver.ts index 0f8377a9c..563c73d24 100644 --- a/backend/src/graphql/resolver/CommunityResolver.ts +++ b/backend/src/graphql/resolver/CommunityResolver.ts @@ -26,13 +26,13 @@ export class CommunityResolver { id: 1, name: 'Gradido Entwicklung', description: 'Die lokale Entwicklungsumgebung von Gradido.', - url: 'http://localhost:3000/vue/', - registerUrl: 'http://localhost:3000/vue/register-community', + url: 'http://localhost/vue/', + registerUrl: 'http://localhost/vue/register-community', }), new Community({ id: 2, name: 'Gradido Staging', - description: 'Der Testserver der Gradido Akademie.', + description: 'Der Testserver der Gradido-Akademie.', url: 'https://stage1.gradido.net/vue/', registerUrl: 'https://stage1.gradido.net/vue/register-community', }), diff --git a/frontend/src/views/Pages/Login.spec.js b/frontend/src/views/Pages/Login.spec.js index 6d4e807e9..13f42dbfe 100644 --- a/frontend/src/views/Pages/Login.spec.js +++ b/frontend/src/views/Pages/Login.spec.js @@ -40,8 +40,8 @@ describe('Login', () => { state: { community: { name: 'Gradido Entwicklung', - url: 'http://localhost:3000/vue/', - registerUrl: 'http://localhost:3000/vue/register', + url: 'http://localhost/vue/', + registerUrl: 'http://localhost/vue/register', description: 'Die lokale Entwicklungsumgebung von Gradido.', }, }, @@ -77,7 +77,7 @@ describe('Login', () => { expect(wrapper.find('div.login-form').exists()).toBeTruthy() }) - it('calls the communityInfo', () => { + it('commits the community info to the store', () => { expect(mockStoreCommit).toBeCalledWith('community', { name: 'test12', description: 'test community 12', @@ -93,11 +93,11 @@ describe('Login', () => { }) describe('Community Data', () => { - it('has a Community name?', () => { + it('has a Community name', () => { expect(wrapper.find('.test-communitydata b').text()).toBe('Gradido Entwicklung') }) - it('has a Community description?', () => { + it('has a Community description', () => { expect(wrapper.find('.test-communitydata p').text()).toBe( 'Die lokale Entwicklungsumgebung von Gradido.', ) @@ -105,13 +105,13 @@ describe('Login', () => { }) describe('links', () => { - it('has a link "Forgot Password?"', () => { + it('has a link "Forgot Password"', () => { expect(wrapper.findAllComponents(RouterLinkStub).at(0).text()).toEqual( 'settings.password.forgot_pwd', ) }) - it('links to /password when clicking "Forgot Password?"', () => { + it('links to /password when clicking "Forgot Password"', () => { expect(wrapper.findAllComponents(RouterLinkStub).at(0).props().to).toBe('/password') }) diff --git a/frontend/src/views/Pages/Register.spec.js b/frontend/src/views/Pages/Register.spec.js index 3dd41cd0e..388a96746 100644 --- a/frontend/src/views/Pages/Register.spec.js +++ b/frontend/src/views/Pages/Register.spec.js @@ -28,8 +28,8 @@ describe('Register', () => { language: 'en', community: { name: 'Gradido Entwicklung', - url: 'http://localhost:3000/vue/', - registerUrl: 'http://localhost:3000/vue/register', + url: 'http://localhost/vue/', + registerUrl: 'http://localhost/vue/register', description: 'Die lokale Entwicklungsumgebung von Gradido.', }, }, diff --git a/frontend/src/views/Pages/RegisterCommunity.spec.js b/frontend/src/views/Pages/RegisterCommunity.spec.js index f015a4e3a..88a60f349 100644 --- a/frontend/src/views/Pages/RegisterCommunity.spec.js +++ b/frontend/src/views/Pages/RegisterCommunity.spec.js @@ -15,8 +15,8 @@ describe('RegisterCommunity', () => { state: { community: { name: 'Gradido Entwicklung', - url: 'http://localhost:3000/vue/', - registerUrl: 'http://localhost:3000/vue/register', + url: 'http://localhost/vue/', + registerUrl: 'http://localhost/vue/register', description: 'Die lokale Entwicklungsumgebung von Gradido.', }, }, @@ -48,9 +48,7 @@ describe('RegisterCommunity', () => { }) it('has a current community location', () => { - expect(wrapper.find('.header p.community-location').text()).toBe( - 'http://localhost:3000/vue/', - ) + expect(wrapper.find('.header p.community-location').text()).toBe('http://localhost/vue/') }) }) diff --git a/frontend/src/views/Pages/RegisterSelectCommunity.spec.js b/frontend/src/views/Pages/RegisterSelectCommunity.spec.js index d2b0b1259..4488e970e 100644 --- a/frontend/src/views/Pages/RegisterSelectCommunity.spec.js +++ b/frontend/src/views/Pages/RegisterSelectCommunity.spec.js @@ -1,6 +1,5 @@ import { mount } from '@vue/test-utils' import RegisterSelectCommunity from './RegisterSelectCommunity' -// const testObject = require('../../../public/json-example/communities.json') const localVue = global.localVue @@ -16,8 +15,8 @@ describe('RegisterSelectCommunity', () => { state: { community: { name: 'Gradido Entwicklung', - url: 'http://localhost:3000/vue/', - registerUrl: 'http://localhost:3000/vue/register', + url: 'http://localhost/vue/', + registerUrl: 'http://localhost/vue/register', description: 'Die lokale Entwicklungsumgebung von Gradido.', }, },