Fix property test CI failure: mock db module before importing route

This commit is contained in:
Jordan Ramos
2026-05-11 14:51:16 -06:00
parent 7245352496
commit 955036145d

View File

@@ -10,6 +10,19 @@
*/ */
const fc = require('fast-check'); 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'); const { filterVisibleSubmissions, shouldShowDismissButton } = require('../routes/ivantiFpWorkflow');
// --- Generators --- // --- Generators ---