From 955036145d32a9df8d74467a55e7a1367f96c336 Mon Sep 17 00:00:00 2001 From: Jordan Ramos Date: Mon, 11 May 2026 14:51:16 -0600 Subject: [PATCH] Fix property test CI failure: mock db module before importing route --- .../fp-submissions-cleanup.property.test.js | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/backend/__tests__/fp-submissions-cleanup.property.test.js b/backend/__tests__/fp-submissions-cleanup.property.test.js index 4d2cc70..12cb164 100644 --- a/backend/__tests__/fp-submissions-cleanup.property.test.js +++ b/backend/__tests__/fp-submissions-cleanup.property.test.js @@ -10,6 +10,19 @@ */ const fc = require('fast-check'); + +// Mock db pool before importing the route module (avoids DATABASE_URL requirement) +jest.mock('../db', () => ({ + query: jest.fn(() => Promise.resolve({ rows: [], rowCount: 0 })), +})); + +// Mock dependencies that the route module imports +jest.mock('../helpers/auditLog', () => jest.fn()); +jest.mock('../helpers/ivantiApi', () => ({ + ivantiFormPost: jest.fn(), + ivantiPost: jest.fn(), +})); + const { filterVisibleSubmissions, shouldShowDismissButton } = require('../routes/ivantiFpWorkflow'); // --- Generators ---