Fix property test CI failure: mock db module before importing route
This commit is contained in:
@@ -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 ---
|
||||||
|
|||||||
Reference in New Issue
Block a user