import { describe, it, expect, vi, beforeEach } from 'vitest'; import { callGeminiAPI, buildSystemPrompt } from './gemini'; describe('gemini utility', () => { beforeEach(() => { vi.clearAllMocks(); }); it('builds system prompt correctly', () => { const prompt = buildSystemPrompt(); expect(prompt).toContain('Assistente Xertica'); }); it.skip('calls Gemini API - requires real API key in .env', async () => { // Skipped by default - API key may exceed quota (429 error) // To enable: change it.skip to it const apiKey = import.meta.env.VITE_GEMINI_API_KEY || ''; if (!apiKey) { console.log('Skipping test - no VITE_GEMINI_API_KEY in .env'); return; } const response = await callGeminiAPI(apiKey, 'hello'); expect(typeof response).toBe('string'); }, 30000); });