2019-12-08 00:32:00 +05:30
|
|
|
import expect from 'app/test/unexpected';
|
2017-05-26 00:41:57 +05:30
|
|
|
import sinon from 'sinon';
|
2016-07-30 16:14:43 +05:30
|
|
|
|
2019-12-08 00:32:00 +05:30
|
|
|
import AuthFlow from 'app/services/authFlow/AuthFlow';
|
|
|
|
import AbstractState from 'app/services/authFlow/AbstractState';
|
|
|
|
import localStorage from 'app/services/localStorage';
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-12-08 00:32:00 +05:30
|
|
|
import OAuthState from 'app/services/authFlow/OAuthState';
|
|
|
|
import RegisterState from 'app/services/authFlow/RegisterState';
|
|
|
|
import RecoverPasswordState from 'app/services/authFlow/RecoverPasswordState';
|
|
|
|
import ForgotPasswordState from 'app/services/authFlow/ForgotPasswordState';
|
|
|
|
import ActivationState from 'app/services/authFlow/ActivationState';
|
|
|
|
import ResendActivationState from 'app/services/authFlow/ResendActivationState';
|
|
|
|
import LoginState from 'app/services/authFlow/LoginState';
|
|
|
|
import CompleteState from 'app/services/authFlow/CompleteState';
|
|
|
|
import ChooseAccountState from 'app/services/authFlow/ChooseAccountState';
|
2016-05-28 03:54:22 +05:30
|
|
|
|
2016-04-12 09:19:58 +05:30
|
|
|
describe('AuthFlow', () => {
|
2019-11-27 14:33:32 +05:30
|
|
|
let flow;
|
|
|
|
let actions;
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
actions = {
|
|
|
|
test: sinon.stub().named('actions.test'),
|
|
|
|
};
|
|
|
|
actions.test.returns('passed');
|
|
|
|
|
|
|
|
flow = new AuthFlow(actions);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('throws when no actions provided', () => {
|
|
|
|
expect(
|
2019-12-07 16:58:52 +05:30
|
|
|
// @ts-ignore
|
2019-11-27 14:33:32 +05:30
|
|
|
() => new AuthFlow(),
|
|
|
|
'to throw',
|
|
|
|
'AuthFlow requires an actions object',
|
|
|
|
);
|
|
|
|
});
|
|
|
|
|
|
|
|
it('should not allow to mutate actions', () => {
|
|
|
|
expect(
|
|
|
|
() => (flow.actions.foo = 'bar'),
|
|
|
|
'to throw',
|
|
|
|
/readonly|not extensible/,
|
|
|
|
);
|
|
|
|
expect(() => (flow.actions.test = 'hacked'), 'to throw', /read ?only/);
|
|
|
|
});
|
|
|
|
|
|
|
|
describe('#setStore', () => {
|
|
|
|
it('should create #navigate, #getState, #dispatch', () => {
|
|
|
|
flow.setStore({
|
|
|
|
getState() {},
|
|
|
|
dispatch() {},
|
|
|
|
});
|
|
|
|
|
|
|
|
expect(flow.getState, 'to be defined');
|
|
|
|
expect(flow.dispatch, 'to be defined');
|
|
|
|
expect(flow.navigate, 'to be defined');
|
2016-04-12 09:19:58 +05:30
|
|
|
});
|
2019-11-27 14:33:32 +05:30
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
describe('#restoreOAuthState', () => {
|
|
|
|
let oauthData;
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
beforeEach(() => {
|
|
|
|
oauthData = { foo: 'bar' };
|
|
|
|
localStorage.setItem(
|
|
|
|
'oauthData',
|
|
|
|
JSON.stringify({
|
|
|
|
timestamp: Date.now() - 10,
|
|
|
|
payload: oauthData,
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
|
|
|
|
sinon.stub(flow, 'run').named('flow.run');
|
|
|
|
const promiseLike = { then: fn => fn() || promiseLike };
|
|
|
|
flow.run.returns(promiseLike);
|
|
|
|
sinon.stub(flow, 'setState').named('flow.setState');
|
2016-04-12 09:19:58 +05:30
|
|
|
});
|
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
afterEach(() => {
|
|
|
|
localStorage.removeItem('oauthData');
|
2016-08-27 15:49:02 +05:30
|
|
|
});
|
2016-08-12 00:50:14 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should call to restoreOAuthState', () => {
|
|
|
|
sinon.stub(flow, 'restoreOAuthState').named('flow.restoreOAuthState');
|
2016-08-27 15:49:02 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.handleRequest({ path: '/' });
|
2016-08-27 15:49:02 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(flow.restoreOAuthState, 'was called');
|
|
|
|
});
|
2016-08-27 15:49:02 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should restore oauth state from localStorage', () => {
|
|
|
|
flow.handleRequest({ path: '/' });
|
2016-08-12 00:50:14 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(flow.run, 'to have a call satisfying', [
|
|
|
|
'oAuthValidate',
|
|
|
|
oauthData,
|
|
|
|
]);
|
|
|
|
});
|
2016-08-12 00:50:14 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should transition to CompleteState', () => {
|
|
|
|
flow.handleRequest({ path: '/' });
|
2016-08-27 15:49:02 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(flow.setState, 'to have a call satisfying', [
|
|
|
|
expect.it('to be a', CompleteState),
|
|
|
|
]);
|
|
|
|
});
|
2016-08-27 15:49:02 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should not handle current request', () => {
|
|
|
|
flow.handleRequest({ path: '/' });
|
2016-08-27 15:49:02 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(flow.setState, 'was called once');
|
|
|
|
});
|
2016-08-27 15:49:02 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should call onReady after state restoration', () => {
|
|
|
|
const onReady = sinon.stub().named('onReady');
|
2016-10-25 12:02:50 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.handleRequest({ path: '/login' }, null, onReady);
|
2016-10-25 12:02:50 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(onReady, 'was called');
|
|
|
|
});
|
2016-10-25 12:02:50 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should not restore oauth state for /register route', () => {
|
|
|
|
flow.handleRequest({ path: '/register' });
|
2016-10-25 11:31:51 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(flow.run, 'was not called'); // this.run('oAuthValidate'...
|
|
|
|
});
|
2016-10-25 11:31:51 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should not restore outdated (>1h) oauth state', () => {
|
|
|
|
localStorage.setItem(
|
|
|
|
'oauthData',
|
|
|
|
JSON.stringify({
|
|
|
|
timestamp: Date.now() - 2 * 60 * 60 * 1000,
|
|
|
|
payload: oauthData,
|
|
|
|
}),
|
|
|
|
);
|
2016-08-12 00:50:14 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.handleRequest({ path: '/' });
|
2016-08-12 00:50:14 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(flow.run, 'was not called');
|
2016-08-12 00:50:14 +05:30
|
|
|
});
|
2019-11-27 14:33:32 +05:30
|
|
|
});
|
2016-08-12 00:50:14 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
describe('#setState', () => {
|
|
|
|
it('should change state', () => {
|
|
|
|
const state = new AbstractState();
|
|
|
|
flow.setState(state);
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(flow.state, 'to be', state);
|
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should call #enter() on new state and pass reference to itself', () => {
|
|
|
|
const state = new AbstractState();
|
|
|
|
const spy = sinon.spy(state, 'enter').named('state.enter');
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.setState(state);
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(spy, 'was called once');
|
|
|
|
expect(spy, 'to have a call satisfying', [flow]);
|
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should call `leave` on previous state if any', () => {
|
|
|
|
class State1 extends AbstractState {}
|
|
|
|
class State2 extends AbstractState {}
|
2016-06-05 17:36:14 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
const state1 = new State1();
|
|
|
|
const state2 = new State2();
|
|
|
|
const spy1 = sinon.spy(state1, 'leave');
|
|
|
|
const spy2 = sinon.spy(state2, 'leave');
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.setState(state1);
|
|
|
|
flow.setState(state2);
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(spy1, 'was called once');
|
|
|
|
expect(spy1, 'to have a call satisfying', [flow]);
|
|
|
|
expect(spy2, 'was not called');
|
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should return promise, if #enter returns it', () => {
|
|
|
|
const state = new AbstractState();
|
|
|
|
const expected = Promise.resolve();
|
2016-06-04 00:40:47 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
state.enter = () => expected;
|
2016-06-04 00:40:47 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
const actual = flow.setState(state);
|
2016-06-04 00:40:47 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(actual, 'to be', expected);
|
|
|
|
});
|
2016-06-04 00:40:47 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should throw if no state', () => {
|
|
|
|
expect(() => flow.setState(), 'to throw', 'State is required');
|
2016-04-12 09:19:58 +05:30
|
|
|
});
|
2019-11-27 14:33:32 +05:30
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
describe('#run', () => {
|
|
|
|
let store;
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
beforeEach(() => {
|
|
|
|
store = {
|
|
|
|
getState() {},
|
|
|
|
dispatch: sinon.stub().named('store.dispatch'),
|
|
|
|
};
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.setStore(store);
|
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should dispatch an action', () => {
|
|
|
|
flow.run('test');
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(store.dispatch, 'was called once');
|
|
|
|
expect(store.dispatch, 'to have a call satisfying', ['passed']);
|
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should dispatch an action with payload given', () => {
|
|
|
|
flow.run('test', 'arg');
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(actions.test, 'was called once');
|
|
|
|
expect(actions.test, 'to have a call satisfying', ['arg']);
|
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should resolve to action dispatch result', () => {
|
|
|
|
const expected = 'dispatch called';
|
|
|
|
store.dispatch.returns(expected);
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
return expect(flow.run('test'), 'to be fulfilled with', expected);
|
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('throws when running unexisted action', () => {
|
|
|
|
expect(() => flow.run('123'), 'to throw', 'Action 123 does not exists');
|
2016-04-12 09:19:58 +05:30
|
|
|
});
|
2019-11-27 14:33:32 +05:30
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
describe('#goBack', () => {
|
|
|
|
it('should call goBack on state passing itself as argument', () => {
|
|
|
|
const state = new AbstractState();
|
|
|
|
sinon.stub(state, 'goBack').named('state.goBack');
|
|
|
|
flow.setState(state);
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.goBack();
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(state.goBack, 'was called once');
|
|
|
|
expect(state.goBack, 'to have a call satisfying', [flow]);
|
2016-04-12 09:19:58 +05:30
|
|
|
});
|
2019-11-27 14:33:32 +05:30
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
describe('#resolve', () => {
|
|
|
|
it('should call resolve on state passing itself and payload as arguments', () => {
|
|
|
|
const state = new AbstractState();
|
|
|
|
sinon.stub(state, 'resolve').named('state.resolve');
|
|
|
|
flow.setState(state);
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
const expectedPayload = { foo: 'bar' };
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.resolve(expectedPayload);
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(state.resolve, 'was called once');
|
|
|
|
expect(state.resolve, 'to have a call satisfying', [
|
|
|
|
flow,
|
|
|
|
expectedPayload,
|
|
|
|
]);
|
2016-04-12 09:19:58 +05:30
|
|
|
});
|
2019-11-27 14:33:32 +05:30
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
describe('#reject', () => {
|
|
|
|
it('should call reject on state passing itself and payload as arguments', () => {
|
|
|
|
const state = new AbstractState();
|
|
|
|
sinon.stub(state, 'reject').named('state.reject');
|
|
|
|
flow.setState(state);
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
const expectedPayload = { foo: 'bar' };
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.reject(expectedPayload);
|
2016-04-12 09:19:58 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(state.reject, 'was called once');
|
|
|
|
expect(state.reject, 'to have a call satisfying', [
|
|
|
|
flow,
|
|
|
|
expectedPayload,
|
|
|
|
]);
|
2016-04-12 09:19:58 +05:30
|
|
|
});
|
2019-11-27 14:33:32 +05:30
|
|
|
});
|
2016-05-28 03:54:22 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
describe('#handleRequest()', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
sinon.stub(flow, 'setState').named('flow.setState');
|
|
|
|
sinon.stub(flow, 'run').named('flow.run');
|
|
|
|
});
|
2016-05-28 03:54:22 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
Object.entries({
|
|
|
|
'/': LoginState,
|
|
|
|
'/login': LoginState,
|
|
|
|
'/password': LoginState,
|
|
|
|
'/accept-rules': LoginState,
|
|
|
|
'/oauth/permissions': LoginState,
|
|
|
|
'/oauth/choose-account': LoginState,
|
|
|
|
'/oauth/finish': LoginState,
|
|
|
|
'/oauth2/v1/foo': OAuthState,
|
|
|
|
'/oauth2/v1': OAuthState,
|
|
|
|
'/oauth2': OAuthState,
|
|
|
|
'/register': RegisterState,
|
|
|
|
'/choose-account': ChooseAccountState,
|
|
|
|
'/recover-password': RecoverPasswordState,
|
|
|
|
'/recover-password/key123': RecoverPasswordState,
|
|
|
|
'/forgot-password': ForgotPasswordState,
|
|
|
|
'/activation': ActivationState,
|
|
|
|
'/resend-activation': ResendActivationState,
|
|
|
|
}).forEach(([path, type]) => {
|
|
|
|
it(`should transition to ${type.name} if ${path}`, () => {
|
|
|
|
flow.handleRequest({ path });
|
|
|
|
|
|
|
|
expect(flow.setState, 'was called once');
|
|
|
|
expect(flow.setState, 'to have a call satisfying', [
|
|
|
|
expect.it('to be a', type),
|
|
|
|
]);
|
|
|
|
});
|
|
|
|
});
|
2016-05-28 03:54:22 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should call callback', () => {
|
|
|
|
const callback = sinon.stub().named('callback');
|
2016-05-28 03:54:22 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.handleRequest({ path: '/' }, () => {}, callback);
|
2016-06-04 00:40:47 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(callback, 'was called once');
|
|
|
|
});
|
2016-06-04 00:40:47 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should not call callback till returned from #enter() promise will be resolved', () => {
|
|
|
|
let resolve;
|
|
|
|
const promise = {
|
|
|
|
then: cb => {
|
|
|
|
resolve = cb;
|
|
|
|
},
|
|
|
|
};
|
|
|
|
const callback = sinon.stub().named('callback');
|
2016-06-04 00:40:47 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
const state = new AbstractState();
|
|
|
|
state.enter = () => promise;
|
2016-07-30 16:14:43 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.setState = AuthFlow.prototype.setState.bind(flow, state);
|
2016-06-04 00:40:47 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.handleRequest({ path: '/' }, () => {}, callback);
|
2016-06-04 00:40:47 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(resolve, 'to be', callback);
|
2016-06-04 00:40:47 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(callback, 'was not called');
|
|
|
|
resolve();
|
|
|
|
expect(callback, 'was called once');
|
|
|
|
});
|
2016-06-04 00:40:47 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should not handle the same request twice', () => {
|
|
|
|
const path = '/oauth2';
|
|
|
|
const callback = sinon.stub();
|
2016-06-04 00:40:47 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.handleRequest({ path }, () => {}, callback);
|
|
|
|
flow.handleRequest({ path }, () => {}, callback);
|
2016-06-15 11:31:41 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(flow.setState, 'was called once');
|
|
|
|
expect(flow.setState, 'to have a call satisfying', [
|
|
|
|
expect.it('to be a', OAuthState),
|
|
|
|
]);
|
|
|
|
expect(callback, 'was called twice');
|
|
|
|
});
|
2016-06-15 11:31:41 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('throws if unsupported request', () => {
|
|
|
|
const replace = sinon.stub().named('replace');
|
2016-06-15 11:31:41 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.handleRequest({ path: '/foo/bar' }, replace);
|
2016-08-07 19:24:59 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(replace, 'to have a call satisfying', ['/404']);
|
|
|
|
});
|
|
|
|
});
|
2016-08-07 19:24:59 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
describe('#getRequest()', () => {
|
|
|
|
beforeEach(() => {
|
|
|
|
sinon.stub(flow, 'setState').named('flow.setState');
|
|
|
|
sinon.stub(flow, 'run').named('flow.run');
|
2016-08-07 19:24:59 +05:30
|
|
|
});
|
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should return request with path, query, params', () => {
|
|
|
|
const request = { path: '/' };
|
|
|
|
|
|
|
|
flow.handleRequest(request);
|
|
|
|
|
|
|
|
expect(flow.getRequest(), 'to satisfy', {
|
|
|
|
...request,
|
|
|
|
query: expect.it('to be an', URLSearchParams),
|
|
|
|
params: {},
|
|
|
|
});
|
|
|
|
});
|
2016-08-07 19:24:59 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
it('should return a copy of current request', () => {
|
|
|
|
const request = {
|
|
|
|
path: '/',
|
|
|
|
query: { foo: 'bar' },
|
|
|
|
params: { baz: 'bud' },
|
|
|
|
};
|
2016-08-07 20:19:26 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
flow.handleRequest(request);
|
2016-08-07 19:24:59 +05:30
|
|
|
|
2019-11-27 14:33:32 +05:30
|
|
|
expect(flow.getRequest(), 'to equal', request);
|
|
|
|
expect(flow.getRequest(), 'not to be', request);
|
2016-05-28 03:54:22 +05:30
|
|
|
});
|
2019-11-27 14:33:32 +05:30
|
|
|
});
|
2016-04-12 09:19:58 +05:30
|
|
|
});
|