+
+ it('should fire external url to login', () => {
+ const initialState = undefined;
+ window.location.assign = jest.fn();
+ authReducer(initialState, actions.LOGIN());
+ expect(window.location.assign).toBeCalledWith(
+ `${API_HOST}/login?return_to=${window.location.protocol}//${window.location.host}/token`
+ );
+ });
+
+ it('should fire external url to logout', () => {
+ const initialState = undefined;
+ window.location.assign = jest.fn();
+ authReducer(initialState, actions.LOGOUT());
+ expect(window.location.assign).toBeCalledWith(
+ `${API_HOST}/logout?return_to=${location.protocol}//${location.host}`
+ );
+ });