This commit is contained in:
SleepWalker 2017-08-22 22:06:38 +03:00
parent 506b2db6ce
commit f19c47f862
4 changed files with 8 additions and 8 deletions

View File

@ -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): * {}
}

View File

@ -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', () => {

View File

@ -31,7 +31,7 @@ export default class MfaState extends AbstractState {
rememberMe
} = getCredentials(context.getState());
context.run('login', {
return context.run('login', {
totp,
password,
rememberMe,

View File

@ -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