Skip to content

Commit

Permalink
Refactor UserAuthorization test; improve formatting of mock setup for…
Browse files Browse the repository at this point in the history
… clarity
  • Loading branch information
simlarsen committed Sep 26, 2024
1 parent 20b5e43 commit a0d77ac
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions Common/Tests/Server/Middleware/UserAuthorization.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down

0 comments on commit a0d77ac

Please sign in to comment.