PW-Reset page switches password reset and verify

This commit is contained in:
Robert Schäfer 2019-06-17 15:17:58 +02:00
parent aa6855434d
commit edd6a3f0c3
3 changed files with 40 additions and 27 deletions

View File

@ -68,8 +68,8 @@ describe('PasswordReset', () => {
describe('after animation', () => { describe('after animation', () => {
beforeEach(jest.runAllTimers) beforeEach(jest.runAllTimers)
it('emits `submitted`', () => { it('emits `handleSubmitted`', () => {
expect(wrapper.emitted('submitted')).toBeTruthy() expect(wrapper.emitted('handleSubmitted')).toBeTruthy()
}) })
}) })
}) })

View File

@ -96,8 +96,8 @@ export default {
this.submitted = true this.submitted = true
setTimeout(() => { setTimeout(() => {
this.$emit('submitted') this.$emit('handleSubmitted')
}, 1000) }, 3000)
} catch (err) { } catch (err) {
this.$toast.error(err.message) this.$toast.error(err.message)
} }

View File

@ -3,7 +3,8 @@
<ds-flex> <ds-flex>
<ds-flex-item :width="{ base: '100%' }" centered> <ds-flex-item :width="{ base: '100%' }" centered>
<ds-space style="text-align: center;" margin-top="small" margin-bottom="xxx-small" centered> <ds-space style="text-align: center;" margin-top="small" margin-bottom="xxx-small" centered>
<password-reset /> <password-reset @handleSubmitted="handleSubmitted" v-if="!submitted" />
<verify-code v-else />
</ds-space> </ds-space>
</ds-flex-item> </ds-flex-item>
</ds-flex> </ds-flex>
@ -12,11 +13,23 @@
<script> <script>
import PasswordReset from '~/components/PasswordReset/PasswordReset' import PasswordReset from '~/components/PasswordReset/PasswordReset'
import VerifyCode from '~/components/PasswordReset/VerifyCode'
export default { export default {
layout: 'default', layout: 'default',
data() {
return {
submitted: false,
}
},
components: { components: {
PasswordReset, PasswordReset,
} VerifyCode,
},
methods: {
handleSubmitted() {
this.submitted = true
},
},
} }
</script> </script>