Merge branch '21037-upgrade-react-scripts'
[arvados.git] / services / workbench2 / src / store / auth / auth-middleware.test.ts
index 5a0364ebf9000162ef7544dccd0607420ba2b290..259478fdc42c8478d431929d66dd4244ece98c6d 100644 (file)
@@ -33,7 +33,9 @@ describe("AuthMiddleware", () => {
 
     it("handles LOGOUT action", () => {
         localStorage.setItem(API_TOKEN_KEY, 'someToken');
-        window.location.assign = jest.fn();
+        Object.defineProperty(window, 'location', {
+            value: { assign: jest.fn(), href: 'http://localhost', protocol: 'http:', host: 'localhost'}
+          });
         const next = jest.fn();
         const middleware = authMiddleware(services)(store)(next);
         middleware(authActions.LOGOUT({deleteLinkData: false, preservePath: false}));