integration test fixes + added new ai models and recipeSuggestion
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 13m36s
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 13m36s
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user