more test improvements
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 19m21s

This commit is contained in:
2026-01-03 00:33:32 -08:00
parent bcf16168b6
commit bad6f74ee6
2 changed files with 5 additions and 1 deletions

View File

@@ -1136,7 +1136,7 @@ describe('AI Service (Server)', () => {
expect(dbModule.adminRepo.logActivity).toHaveBeenCalledWith(
expect.objectContaining({
action: 'flyer_processed',
userId: 'u1',
userId: mockProfile.user.user_id,
}),
mockLoggerInstance,
);

View File

@@ -7,6 +7,10 @@ import { ValidationError, NotFoundError } from './db/errors.db';
import type { Job } from 'bullmq';
import type { TokenCleanupJobData } from '../types/job-data';
// Un-mock the service under test to ensure we are testing the real implementation,
// not the global mock from `tests/setup/tests-setup-unit.ts`.
vi.unmock('./userService');
// --- Hoisted Mocks ---
const mocks = vi.hoisted(() => {
// Create mock implementations for the repository methods we'll be using.