Move to next step after verify code

This commit is contained in:
Robert Schäfer 2019-06-18 12:41:58 +02:00
parent 8fc74b9e14
commit de40499007
2 changed files with 19 additions and 2 deletions

View File

@ -39,7 +39,16 @@ describe('VerifyCode ', () => {
})
describe('after verification code given', () => {
it.todo('displays a form to update your password')
beforeEach(() => {
wrapper = Wrapper()
wrapper.find('input').setValue('123456')
wrapper.find('form').trigger('submit')
})
it('displays a form to update your password', () => {
expect(wrapper.find('.change-password').exists()).toBe(true)
})
describe('submitting new password', () => {
it.todo('calls resetPassword graphql mutation')
it.todo('delivers new password to backend')

View File

@ -1,7 +1,7 @@
<template>
<ds-card class="verify-code">
<ds-space margin="large">
<ds-form v-model="formData" :schema="formSchema" @submit="handleSubmit">
<ds-form v-if="!codeSubmitted" v-model="formData" :schema="formSchema" @submit="handleSubmit">
<ds-input
:placeholder="$t('verify-code.form.input')"
model="code"
@ -24,11 +24,13 @@
{{ $t('verify-code.form.submit') }}
</ds-button>
</ds-form>
<div v-else class="change-password" />
</ds-space>
</ds-card>
</template>
<script>
export default {
data() {
return {
@ -44,7 +46,13 @@ export default {
message: this.$t('common.validations.verification-code'),
},
},
codeSubmitted: false
}
},
methods: {
handleSubmit(){
this.codeSubmitted = true
}
}
}
</script>