Skip to content

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

feat(secret-sync): add mock implementation for findConnectionId in tests

Victor Hugo dos Santosa2d5104c14b2
diff --git a/backend/src/services/secret-sync/secret-sync-queue.test.ts b/backend/src/services/secret-sync/secret-sync-queue.test.ts
index d9b019bd8d..fb55c59402 100644
--- a/backend/src/services/secret-sync/secret-sync-queue.test.ts
+++ b/backend/src/services/secret-sync/secret-sync-queue.test.ts
@@ -77,6 +77,7 @@ const createHarness = (initial: TSyncState, { lockFails = false, staleLoad = fal
};
const snapshot = { ...state };
const secretSyncDAL = {
+ findConnectionId: vi.fn(async () => state.connectionId),
// Every attempt reloads the sync, as the real handler does.
findById: vi.fn(async () => (staleLoad ? { ...snapshot } : { ...state })),
// A conditional UPDATE: only a row still matching the filter is changed and returned.