From 2037dc353ddfc0ae182189f69159ef00e637fba9 Mon Sep 17 00:00:00 2001 From: Lisa Knox Date: Fri, 19 Apr 2024 09:28:07 -0400 Subject: [PATCH] 21037: fixed auth-middleware test Arvados-DCO-1.1-Signed-off-by: Lisa Knox --- services/workbench2/src/store/auth/auth-middleware.test.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/services/workbench2/src/store/auth/auth-middleware.test.ts b/services/workbench2/src/store/auth/auth-middleware.test.ts index 5a0364ebf9..259478fdc4 100644 --- a/services/workbench2/src/store/auth/auth-middleware.test.ts +++ b/services/workbench2/src/store/auth/auth-middleware.test.ts @@ -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})); -- 2.30.2