mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-05-31 14:11:58 +05:30
#192: respect user-entered email in forgotPassword state
This commit is contained in:
@@ -84,6 +84,25 @@ describe('ForgotPasswordState', () => {
|
||||
state.resolve(context, {});
|
||||
});
|
||||
|
||||
it('should call forgotPassword with email from payload if any', () => {
|
||||
const expectedLogin = 'foo@bar.com';
|
||||
context.getState.returns({
|
||||
user: {
|
||||
email: 'should.not@be.used'
|
||||
}
|
||||
});
|
||||
|
||||
expectRun(
|
||||
mock,
|
||||
'forgotPassword',
|
||||
sinon.match({
|
||||
login: expectedLogin
|
||||
})
|
||||
).returns({then() {}});
|
||||
|
||||
state.resolve(context, {email: expectedLogin});
|
||||
});
|
||||
|
||||
it('should call forgotPassword with username', () => {
|
||||
const expectedLogin = 'foobar';
|
||||
context.getState.returns({
|
||||
|
Reference in New Issue
Block a user