let store: RootStore;
let services: ServiceRepository;
let axiosInst: AxiosInstance;
+ const config: any = {};
const actions: ApiActions = {
progressFn: (id: string, working: boolean) => { },
errorFn: (id: string, message: string) => { }
beforeEach(() => {
axiosInst = Axios.create({ headers: {} });
services = createServices(mockConfig({}), actions, axiosInst);
- store = configureStore(createBrowserHistory(), services);
+ store = configureStore(createBrowserHistory(), services, config);
localStorage.clear();
});
const middleware = authMiddleware(services)(store)(next);
middleware(authActions.LOGOUT({deleteLinkData: false}));
expect(window.location.assign).toBeCalledWith(
- `/logout?return_to=${location.protocol}//${location.host}`
+ `/logout?api_token=someToken&return_to=${location.protocol}//${location.host}`
);
expect(localStorage.getItem(API_TOKEN_KEY)).toBeFalsy();
});