X-Git-Url: https://git.arvados.org/arvados-workbench2.git/blobdiff_plain/847f19027dbe050bdceb835f4c8c67d386159a72..7632d98ba8b9a585551e1894482a2b21713b9344:/src/store/auth/auth-middleware.test.ts diff --git a/src/store/auth/auth-middleware.test.ts b/src/store/auth/auth-middleware.test.ts index 1fe34381..1438cab3 100644 --- a/src/store/auth/auth-middleware.test.ts +++ b/src/store/auth/auth-middleware.test.ts @@ -18,6 +18,7 @@ describe("AuthMiddleware", () => { 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) => { } @@ -26,7 +27,7 @@ describe("AuthMiddleware", () => { beforeEach(() => { axiosInst = Axios.create({ headers: {} }); services = createServices(mockConfig({}), actions, axiosInst); - store = configureStore(createBrowserHistory(), services); + store = configureStore(createBrowserHistory(), services, config); localStorage.clear(); }); @@ -37,7 +38,7 @@ describe("AuthMiddleware", () => { 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(); });