mirror of
https://github.com/IT4Change/gradido.git
synced 2026-01-20 20:01:31 +00:00
Merge branch 'master' into gdd-amount-in-navbar
This commit is contained in:
commit
c0e092ca40
@ -2,7 +2,7 @@
|
||||
<div class="component-nabvar">
|
||||
<b-navbar toggleable="md" type="dark" variant="success" class="p-3">
|
||||
<b-navbar-brand to="/">
|
||||
<img src="img/brand/green.png" class="navbar-brand-img" alt="..." />
|
||||
<img src="img/brand/gradido_logo_w.png" class="navbar-brand-img" alt="..." />
|
||||
</b-navbar-brand>
|
||||
|
||||
<b-navbar-toggle target="nav-collapse"></b-navbar-toggle>
|
||||
|
||||
@ -120,7 +120,6 @@
|
||||
"overview": "Übersicht",
|
||||
"privacy_policy": "Datenschutzerklärung",
|
||||
"publisher": {
|
||||
"infoNoRegister": "Dies ist für die Registrieung nicht nötig.",
|
||||
"infoText": "Wenn dir dein Empfehlungsgeber seine Publisher-Id gegeben hat, trage sie hier ein, sonst lass das Feld bitte unverändert!",
|
||||
"publisherId": "Publisher-Id"
|
||||
},
|
||||
|
||||
@ -120,7 +120,6 @@
|
||||
"overview": "Overview",
|
||||
"privacy_policy": "Privacy policy",
|
||||
"publisher": {
|
||||
"infoNoRegister": "This is not necessary for registration.",
|
||||
"infoText": "If your referrer has given you his publisher id, enter it here, otherwise leave the field unchanged!",
|
||||
"publisherId": "PublisherID"
|
||||
},
|
||||
|
||||
@ -214,21 +214,55 @@ describe('Register', () => {
|
||||
})
|
||||
*/
|
||||
|
||||
describe('API calls', () => {
|
||||
describe('API calls when form is missing input', () => {
|
||||
beforeEach(() => {
|
||||
wrapper.find('#registerFirstname').setValue('Max')
|
||||
wrapper.find('#registerLastname').setValue('Mustermann')
|
||||
wrapper.find('.language-switch-select').findAll('option').at(1).setSelected()
|
||||
wrapper.find('#publisherid').setValue('12345')
|
||||
})
|
||||
it('has disabled submit button when missing input checked box', () => {
|
||||
wrapper.find('#Email-input-field').setValue('max.mustermann@gradido.net')
|
||||
expect(wrapper.find('button[type="submit"]').attributes('disabled')).toBe('disabled')
|
||||
})
|
||||
|
||||
it('has disabled submit button when missing email input', () => {
|
||||
wrapper.find('#registerCheckbox').setChecked()
|
||||
expect(wrapper.find('button[type="submit"]').attributes('disabled')).toBe('disabled')
|
||||
})
|
||||
})
|
||||
|
||||
describe('API calls when completely filled and missing publisherid', () => {
|
||||
beforeEach(() => {
|
||||
wrapper.find('#registerFirstname').setValue('Max')
|
||||
wrapper.find('#registerLastname').setValue('Mustermann')
|
||||
wrapper.find('#Email-input-field').setValue('max.mustermann@gradido.net')
|
||||
wrapper.find('.language-switch-select').findAll('option').at(1).setSelected()
|
||||
wrapper.find('#registerCheckbox').setChecked()
|
||||
})
|
||||
it('has enabled submit button when completely filled', async () => {
|
||||
await wrapper.vm.$nextTick()
|
||||
expect(wrapper.find('button[type="submit"]').attributes('disabled')).toBe(undefined)
|
||||
})
|
||||
})
|
||||
|
||||
describe('API calls when completely filled', () => {
|
||||
beforeEach(() => {
|
||||
wrapper.find('#registerFirstname').setValue('Max')
|
||||
wrapper.find('#registerLastname').setValue('Mustermann')
|
||||
wrapper.find('#Email-input-field').setValue('max.mustermann@gradido.net')
|
||||
wrapper.find('.language-switch-select').findAll('option').at(1).setSelected()
|
||||
wrapper.find('#publisherid').setValue('12345')
|
||||
wrapper.find('#registerCheckbox').setChecked()
|
||||
})
|
||||
|
||||
it('commits publisherId to store', () => {
|
||||
expect(mockStoreCommit).toBeCalledWith('publisherId', 12345)
|
||||
})
|
||||
|
||||
it('has enabled submit button when completely filled', () => {
|
||||
expect(wrapper.find('button[type="submit"]').attributes('disabled')).toBe('disabled')
|
||||
it('has enabled submit button when completely filled', async () => {
|
||||
await wrapper.vm.$nextTick()
|
||||
expect(wrapper.find('button[type="submit"]').attributes('disabled')).toBe(undefined)
|
||||
})
|
||||
|
||||
describe('server sends back error', () => {
|
||||
|
||||
@ -145,7 +145,6 @@
|
||||
class="text-center mt-1 shadow-lg p-3 mb-5 rounded"
|
||||
>
|
||||
{{ $t('publisher.infoText') }}
|
||||
<span class="text-dark">{{ $t('publisher.infoNoRegister') }}</span>
|
||||
<div class="text-center">
|
||||
<b-icon icon="chevron-up" aria-hidden="true"></b-icon>
|
||||
</div>
|
||||
@ -162,9 +161,9 @@
|
||||
</b-button>
|
||||
</router-link>
|
||||
<b-button
|
||||
:disabled="!(namesFilled && emailFilled && form.agree && !!language)"
|
||||
:disabled="disabled"
|
||||
type="submit"
|
||||
variant="primary"
|
||||
:variant="disabled ? 'outline-light' : 'primary'"
|
||||
>
|
||||
{{ $t('signup') }}
|
||||
</b-button>
|
||||
@ -268,6 +267,9 @@ export default {
|
||||
emailFilled() {
|
||||
return this.form.email !== ''
|
||||
},
|
||||
disabled() {
|
||||
return !(this.namesFilled && this.emailFilled && this.form.agree && !!this.language)
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user