mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Flesh out VerifyCode.spec.js
This commit is contained in:
parent
a641ab6884
commit
288e5002fd
@ -20,7 +20,7 @@ describe('VerifyCode ', () => {
|
||||
$t: jest.fn(),
|
||||
$apollo: {
|
||||
loading: false,
|
||||
mutate: jest.fn().mockResolvedValue({ data: { resetPassword: false } }),
|
||||
mutate: jest.fn().mockResolvedValue({ data: { resetPassword: true } }),
|
||||
},
|
||||
}
|
||||
})
|
||||
@ -50,9 +50,27 @@ describe('VerifyCode ', () => {
|
||||
})
|
||||
|
||||
describe('submitting new password', () => {
|
||||
it.todo('calls resetPassword graphql mutation')
|
||||
it.todo('delivers new password to backend')
|
||||
it.todo('displays success message')
|
||||
beforeEach(() => {
|
||||
wrapper.find('input#newPassword').setValue('supersecret')
|
||||
wrapper.find('input#confirmPassword').setValue('supersecret')
|
||||
wrapper.find('form').trigger('submit')
|
||||
})
|
||||
|
||||
it('calls resetPassword graphql mutation', () => {
|
||||
expect(mocks.$apollo.mutate).toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('delivers new password to backend', () => {
|
||||
const expected = expect.objectContaining({ variables: { newPassword: 'supersecret' } })
|
||||
expect(mocks.$apollo.mutate).toHaveBeenCalledWith(expected)
|
||||
})
|
||||
|
||||
describe('password reset successful', () => {
|
||||
it('displays success message', () => {
|
||||
const expected = 'verify-code.change-password.sucess'
|
||||
expect(mocks.$t).toHaveBeenCalledWith(expected)
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
@ -26,7 +26,11 @@
|
||||
"form": {
|
||||
"input": "Code eingeben",
|
||||
"description": "Öffne Deine E-Mail Postfach und gib den Code ein, den wir geschickt haben.",
|
||||
"submit": "Sicherheitscode überprüfen"
|
||||
"submit": "Sicherheitscode überprüfen",
|
||||
"change-password":{
|
||||
"success": "Änderung des Passworts war erfolgreich",
|
||||
"failure": "Passwort Änderung fehlgeschlagen. Möglicherweise falscher Sicherheitscode."
|
||||
}
|
||||
}
|
||||
},
|
||||
"editor": {
|
||||
|
||||
@ -26,7 +26,11 @@
|
||||
"form": {
|
||||
"input": "Enter your code",
|
||||
"description": "Open your inbox and enter the code that we've sent to you.",
|
||||
"submit": "Check security code"
|
||||
"submit": "Check security code",
|
||||
"change-password": {
|
||||
"success": "Changing your password was successful",
|
||||
"failure": "Changing your password failed. Probably the security code was not correct"
|
||||
}
|
||||
}
|
||||
},
|
||||
"editor": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user