From a0d77ac1045025c2eccc05c48ca9486ab65cb600 Mon Sep 17 00:00:00 2001 From: Simon Larsen Date: Thu, 26 Sep 2024 17:11:18 +0100 Subject: [PATCH] Refactor UserAuthorization test; improve formatting of mock setup for clarity --- Common/Tests/Server/Middleware/UserAuthorization.test.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Common/Tests/Server/Middleware/UserAuthorization.test.ts b/Common/Tests/Server/Middleware/UserAuthorization.test.ts index 76529d1dfe..7445320b94 100644 --- a/Common/Tests/Server/Middleware/UserAuthorization.test.ts +++ b/Common/Tests/Server/Middleware/UserAuthorization.test.ts @@ -281,9 +281,10 @@ describe("UserMiddleware", () => { projectId, ); getJestSpyOn(ProjectMiddleware, "hasApiKey").mockReturnValue(false); - getJestSpyOn(UserMiddleware, "getAccessTokenFromExpressRequest").mockReturnValue( - mockedAccessToken, - ); + getJestSpyOn( + UserMiddleware, + "getAccessTokenFromExpressRequest", + ).mockReturnValue(mockedAccessToken); getJestSpyOn(JSONWebToken, "decode").mockReturnValue(jwtTokenData); getJestSpyOn(HashedString, "hashValue").mockResolvedValue(hashValue); });