mirror of
https://github.com/elyby/accounts-frontend.git
synced 2024-11-10 01:52:04 +05:30
#305: fix tests
This commit is contained in:
parent
506b2db6ce
commit
f19c47f862
@ -3,11 +3,11 @@
|
||||
import type { AuthContext } from 'services/authFlow';
|
||||
|
||||
export default class AbstractState {
|
||||
resolve(context: AuthContext, payload: Object): void {}
|
||||
goBack(context: AuthContext): void {
|
||||
resolve(context: AuthContext, payload: Object): * {}
|
||||
goBack(context: AuthContext): * {
|
||||
throw new Error('There is no way back');
|
||||
}
|
||||
reject(context: AuthContext, payload: Object): void {}
|
||||
enter(context: AuthContext): void {}
|
||||
leave(context: AuthContext): void {}
|
||||
reject(context: AuthContext, payload: Object): * {}
|
||||
enter(context: AuthContext): * {}
|
||||
leave(context: AuthContext): * {}
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ describe('AuthFlow', () => {
|
||||
const expected = 'dispatch called';
|
||||
store.dispatch.returns(expected);
|
||||
|
||||
expect(flow.run('test'), 'to be fulfilled with', expected);
|
||||
return expect(flow.run('test'), 'to be fulfilled with', expected);
|
||||
});
|
||||
|
||||
it('throws when running unexisted action', () => {
|
||||
|
@ -31,7 +31,7 @@ export default class MfaState extends AbstractState {
|
||||
rememberMe
|
||||
} = getCredentials(context.getState());
|
||||
|
||||
context.run('login', {
|
||||
return context.run('login', {
|
||||
totp,
|
||||
password,
|
||||
rememberMe,
|
||||
|
@ -33,7 +33,7 @@ export default class PasswordState extends AbstractState {
|
||||
) {
|
||||
const {login} = getCredentials(context.getState());
|
||||
|
||||
context.run('login', {
|
||||
return context.run('login', {
|
||||
password,
|
||||
rememberMe,
|
||||
login
|
||||
|
Loading…
Reference in New Issue
Block a user