mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Merge branch 'master' into 1320-Transactionlist-for-user-Decay-Balance
This commit is contained in:
commit
9f21892d51
@ -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', () => {
|
||||
|
||||
@ -161,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>
|
||||
@ -267,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