Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

fix tests

adilson3896dd1ce474
diff --git a/backend/src/ee/services/secret-change-global-request-bridge/secret-change-global-request-bridge-service.test.ts b/backend/src/ee/services/secret-change-global-request-bridge/secret-change-global-request-bridge-service.test.ts
index ea782e9a17..d4d53a1813 100644
--- a/backend/src/ee/services/secret-change-global-request-bridge/secret-change-global-request-bridge-service.test.ts
+++ b/backend/src/ee/services/secret-change-global-request-bridge/secret-change-global-request-bridge-service.test.ts
@@ -1067,12 +1067,14 @@ describe("secretChangeGlobalRequestBridge updateSecretChangeRequestStatus", () =
expect(queueChangeRequestWebhook).not.toHaveBeenCalled();
});
- test("refuses when the plan lacks secret approvals", async () => {
+ test("closes a request when the plan lacks secret approvals and refuses reopening one", async () => {
const { service, deps } = buildService();
deps.licenseService.getPlan.mockResolvedValue({ secretApproval: false });
- await expect(setStatus(service)).rejects.toThrow("plan restriction");
+ await expect(setStatus(service, { status: RequestState.Open })).rejects.toThrow("plan restriction");
expect(deps.approvalRequestDAL.findById).not.toHaveBeenCalled();
+
+ await expect(setStatus(service)).resolves.toMatchObject({ status: ApprovalRequestStatus.Closed });
});
test("reads an unknown id or a request of another type as not found", async () => {