mirror of
https://github.com/IT4Change/gradido.git
synced 2026-04-06 01:25:28 +00:00
Merge branch 'master' into 1197-admin-interface-created-transactions-list
This commit is contained in:
commit
3c80775d20
@ -251,6 +251,44 @@ describe('Login', () => {
|
|||||||
it('toasts an error message', () => {
|
it('toasts an error message', () => {
|
||||||
expect(toastErrorMock).toBeCalledWith('error.no-account')
|
expect(toastErrorMock).toBeCalledWith('error.no-account')
|
||||||
})
|
})
|
||||||
|
|
||||||
|
describe('login fails with "User email not validated"', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
apolloQueryMock.mockRejectedValue({
|
||||||
|
message: 'User email not validated',
|
||||||
|
})
|
||||||
|
wrapper = Wrapper()
|
||||||
|
jest.clearAllMocks()
|
||||||
|
await wrapper.find('input[placeholder="Email"]').setValue('user@example.org')
|
||||||
|
await wrapper.find('input[placeholder="form.password"]').setValue('1234')
|
||||||
|
await flushPromises()
|
||||||
|
await wrapper.find('form').trigger('submit')
|
||||||
|
await flushPromises()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('redirects to /thx/login', () => {
|
||||||
|
expect(mockRouterPush).toBeCalledWith('/thx/login')
|
||||||
|
})
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('login fails with "User has no password set yet"', () => {
|
||||||
|
beforeEach(async () => {
|
||||||
|
apolloQueryMock.mockRejectedValue({
|
||||||
|
message: 'User has no password set yet',
|
||||||
|
})
|
||||||
|
wrapper = Wrapper()
|
||||||
|
jest.clearAllMocks()
|
||||||
|
await wrapper.find('input[placeholder="Email"]').setValue('user@example.org')
|
||||||
|
await wrapper.find('input[placeholder="form.password"]').setValue('1234')
|
||||||
|
await flushPromises()
|
||||||
|
await wrapper.find('form').trigger('submit')
|
||||||
|
await flushPromises()
|
||||||
|
})
|
||||||
|
|
||||||
|
it('redirects to /reset/login', () => {
|
||||||
|
expect(mockRouterPush).toBeCalledWith('/reset/login')
|
||||||
|
})
|
||||||
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
@ -105,10 +105,10 @@ export default {
|
|||||||
loader.hide()
|
loader.hide()
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
if (error.message.includes('No user with this credentials')) {
|
this.$toasted.global.error(this.$t('error.no-account'))
|
||||||
this.$toasted.global.error(this.$t('error.no-account'))
|
if (error.message.includes('User email not validated')) {
|
||||||
} else {
|
this.$router.push('/thx/login')
|
||||||
// : this.$t('error.no-email-verify')
|
} else if (error.message.includes('User has no password set yet')) {
|
||||||
this.$router.push('/reset/login')
|
this.$router.push('/reset/login')
|
||||||
}
|
}
|
||||||
loader.hide()
|
loader.hide()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user