mirror of
https://github.com/IT4Change/gradido.git
synced 2026-01-15 01:14:35 +00:00
test regexp to catch error message
This commit is contained in:
parent
40520c6718
commit
b0300e5a08
@ -149,13 +149,17 @@ describe('ResetPassword', () => {
|
||||
describe('server response with error code > 10min', () => {
|
||||
beforeEach(async () => {
|
||||
jest.clearAllMocks()
|
||||
apolloMutationMock.mockRejectedValue({ message: '...Code is older than 10 minutes' })
|
||||
apolloMutationMock.mockRejectedValue({
|
||||
message: '...email was sent more than 23 hours and 10 minutes ago',
|
||||
})
|
||||
await wrapper.find('form').trigger('submit')
|
||||
await flushPromises()
|
||||
})
|
||||
|
||||
it('toasts an error message', () => {
|
||||
expect(toastErrorSpy).toHaveBeenCalledWith('...Code is older than 10 minutes')
|
||||
expect(toastErrorSpy).toHaveBeenCalledWith(
|
||||
'...email was sent more than 23 hours and 10 minutes ago',
|
||||
)
|
||||
})
|
||||
|
||||
it('router pushes to /forgot-password/resetPassword', () => {
|
||||
|
||||
@ -106,7 +106,7 @@ export default {
|
||||
this.toastError(error.message)
|
||||
if (
|
||||
error.message.match(
|
||||
/email was sent more than ([0-9]+ hours)?( and)?([0-9]+ minutes)? ago/,
|
||||
/email was sent more than ([0-9]+ hours)?( and )?([0-9]+ minutes)? ago/,
|
||||
)
|
||||
)
|
||||
this.$router.push('/forgot-password/resetPassword')
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user