accounts-frontend/packages/app/services/authFlow/FinishState.test.ts

31 lines
704 B
TypeScript
Raw Normal View History

import FinishState from 'app/services/authFlow/FinishState';
import { SinonMock } from 'sinon';
import { bootstrap, expectNavigate, MockedAuthContext } from './helpers';
describe('FinishState', () => {
2020-05-24 04:38:24 +05:30
let state: FinishState;
let context: MockedAuthContext;
let mock: SinonMock;
2020-05-24 04:38:24 +05:30
beforeEach(() => {
state = new FinishState();
2020-05-24 04:38:24 +05:30
const data = bootstrap();
context = data.context;
mock = data.mock;
});
2020-05-24 04:38:24 +05:30
afterEach(() => {
mock.verify();
});
2020-05-24 04:38:24 +05:30
describe('#enter', () => {
it('should navigate to /oauth/finish', () => {
expectNavigate(mock, '/oauth/finish');
2020-05-24 04:38:24 +05:30
state.enter(context);
});
});
});