Refactor UserAuthorization test; improve formatting of mock setup for clarity

This commit is contained in:
Simon Larsen 2024-09-26 17:11:18 +01:00
parent 20b5e43b26
commit a0d77ac104
No known key found for this signature in database
GPG Key ID: 96C5DCA24769DBCA

View File

@ -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);
});