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