2019-12-08 00:32:00 +05:30
|
|
|
import FinishState from 'app/services/authFlow/FinishState';
|
2020-01-18 02:07:52 +05:30
|
|
|
import { SinonMock } from 'sinon';
|
2016-03-21 11:46:37 +05:30
|
|
|
|
2020-01-18 02:07:52 +05:30
|
|
|
import { bootstrap, expectNavigate, MockedAuthContext } from './helpers';
|
2016-03-21 11:46:37 +05:30
|
|
|
|
|
|
|
describe('FinishState', () => {
|
2020-05-24 04:38:24 +05:30
|
|
|
let state: FinishState;
|
|
|
|
let context: MockedAuthContext;
|
|
|
|
let mock: SinonMock;
|
2016-03-21 11:46:37 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
beforeEach(() => {
|
|
|
|
state = new FinishState();
|
2016-03-21 11:46:37 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
const data = bootstrap();
|
|
|
|
context = data.context;
|
|
|
|
mock = data.mock;
|
|
|
|
});
|
2016-03-21 11:46:37 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
afterEach(() => {
|
|
|
|
mock.verify();
|
|
|
|
});
|
2016-03-21 11:46:37 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
describe('#enter', () => {
|
|
|
|
it('should navigate to /oauth/finish', () => {
|
|
|
|
expectNavigate(mock, '/oauth/finish');
|
2016-03-21 11:46:37 +05:30
|
|
|
|
2020-05-24 04:38:24 +05:30
|
|
|
state.enter(context);
|
|
|
|
});
|
2016-03-21 11:46:37 +05:30
|
|
|
});
|
|
|
|
});
|