tests register fix

This commit is contained in:
ogerly 2021-09-30 09:03:11 +02:00
parent defabccf86
commit 2065bcbfb7
9 changed files with 50 additions and 22 deletions

View File

@ -1,7 +1,7 @@
{
"back": "Zurück",
"community": {
"choose-another-aommunity": "Eine andere Gemeinschaft auswählen",
"choose-another-community": "Eine andere Gemeinschaft auswählen",
"community": "Gemeinschaft",
"communitys": {
"form": {

View File

@ -1,7 +1,7 @@
{
"back": "Back",
"community": {
"choose-another-aommunity": "Choose another community",
"choose-another-community": "Choose another community",
"community": "Community",
"communitys": {
"form": {

View File

@ -32,7 +32,7 @@
</b-col>
</b-row>
<div class="text-center py-lg-4">
<b-button variant="outline-secondary" to="/login">{{ $t('back') }}</b-button>
<router-link to="/Login" class="mt-3">{{ $t('back') }}</router-link>
</div>
</b-container>
</div>

View File

@ -30,6 +30,14 @@ describe('Login', () => {
$t: jest.fn((t) => t),
$store: {
dispatch: mockStoreDispach,
state: {
community: {
name: 'Gradido Entwicklung',
url: 'http://localhost:3000/vue/',
registerUrl: 'http://localhost:3000/vue/register',
description: 'Die lokale Entwicklungsumgebung von Gradido.',
},
},
},
$loading: {
show: spinnerMock,
@ -86,7 +94,7 @@ describe('Login', () => {
})
it('links to /register when clicking "Create new account"', () => {
expect(wrapper.findAllComponents(RouterLinkStub).at(1).props().to).toBe('/register')
expect(wrapper.findAllComponents(RouterLinkStub).at(1).props().to).toBe('/regist-community')
})
})

View File

@ -44,18 +44,18 @@
</b-card>
<b-row class="mt-3">
<b-col cols="6" class="text-center text-sm-left col-12 col-sm-6 pb-5">
<b-button variant="outline-secondary" to="/password">
<router-link to="/password" class="mt-3">
{{ $t('settings.password.forgot_pwd') }}
</b-button>
</router-link>
</b-col>
<b-col
cols="6"
class="text-center text-sm-right col-12 col-sm-6"
v-show="allowRegister"
>
<b-button variant="outline-secondary" to="/regist-community">
<router-link to="/regist-community" class="mt-3">
{{ $t('site.login.new_wallet') }}
</b-button>
</router-link>
</b-col>
</b-row>
</b-col>

View File

@ -26,6 +26,12 @@ describe('Register', () => {
state: {
email: 'peter@lustig.de',
language: 'en',
community: {
name: 'Gradido Entwicklung',
url: 'http://localhost:3000/vue/',
registerUrl: 'http://localhost:3000/vue/register',
description: 'Die lokale Entwicklungsumgebung von Gradido.',
},
},
},
}
@ -127,6 +133,18 @@ describe('Register', () => {
})
})
describe('link Choose another community', () => {
it('has a link "Choose another community"', () => {
expect(wrapper.find('.test-button-another-community').text()).toEqual(
'community.choose-another-community',
)
})
it('links to /select-community when clicking "Choose another community"', () => {
expect(wrapper.find('.test-button-another-community').props().to).toBe('/select-community')
})
})
describe('API calls', () => {
beforeEach(() => {
wrapper.find('#registerFirstname').setValue('Max')

View File

@ -10,14 +10,6 @@
<p class="text-lead">{{ $t('site.signup.subtitle') }}</p>
</b-col>
</b-row>
<b-row class="justify-content-center pb-3">
<b-col xl="5" lg="6" md="8" class="px-2">
<b>{{ $store.state.community.name }}</b>
<p class="text-lead">
{{ $store.state.community.description }}
</p>
</b-col>
</b-row>
</div>
</b-container>
</div>
@ -31,7 +23,11 @@
<b-card no-body class="border-0" style="background-color: #ebebeba3 !important">
<b-card-body class="p-4">
<div class="text-center text-muted mb-4">
<small>{{ $t('signup') }}</small>
<b>{{ $store.state.community.name }}</b>
<p class="text-lead">
{{ $store.state.community.description }}
</p>
<div>{{ $t('signup') }}</div>
</div>
<validation-observer ref="observer" v-slot="{ handleSubmit }">
@ -128,7 +124,9 @@
<div class="text-center">
<div class="text-center">
<b-button variant="outline-secondary" to="/login">{{ $t('back') }}</b-button>
<b-button class="test-button-back" variant="outline-secondary" to="/login">
{{ $t('back') }}
</b-button>
<b-button
:disabled="!(namesFilled && emailFilled && form.agree && languageFilled)"
@ -147,8 +145,12 @@
</b-row>
</b-container>
<div class="text-center pt-4">
<b-button variant="outline-secondary" to="/select-community">
{{ $t('community.choose-another-aommunity') }}
<b-button
class="test-button-another-community"
variant="outline-secondary"
to="/select-community"
>
{{ $t('community.choose-another-community') }}
</b-button>
</div>
</div>

View File

@ -27,7 +27,7 @@
<b-row>
<b-col class="text-center">
<b-button variant="outline-secondary" to="/select-community">
{{ $t('community.choose-another-aommunity') }}
{{ $t('community.choose-another-community') }}
</b-button>
</b-col>
</b-row>

View File

@ -40,7 +40,7 @@
</b-row>
<b-row>
<b-col class="text-center py-lg-4">
<b-button variant="outline-secondary" to="/login">{{ $t('back') }}</b-button>
<router-link to="/Login" class="mt-3">{{ $t('back') }}</router-link>
</b-col>
</b-row>
</b-container>