integration test fixes + added new ai models and recipeSuggestion
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 13m36s

This commit is contained in:
2026-01-01 18:29:52 -08:00
parent 146d4c1351
commit 4528da2934
4 changed files with 178 additions and 63 deletions

View File

@@ -7,12 +7,6 @@ import { cleanupDb } from '../utils/cleanup';
import type { UserProfile, Recipe, RecipeComment } from '../../types';
import { getPool } from '../../services/db/connection.db';
// Mock the AI service
vi.mock('../../services/aiService.server', () => ({
aiService: {
generateRecipeSuggestion: vi.fn(),
},
}));
import { aiService } from '../../services/aiService.server';
/**
@@ -39,6 +33,9 @@ describe('Recipe API Routes Integration Tests', () => {
authToken = token;
createdUserIds.push(user.user.user_id);
// Mock the AI service method using spyOn to preserve other exports like DuplicateFlyerError
vi.spyOn(aiService, 'generateRecipeSuggestion').mockResolvedValue('Default Mock Suggestion');
// Create a recipe owned by the test user
const recipeRes = await getPool().query(
`INSERT INTO public.recipes (name, instructions, user_id, status, description)