Add a goosed over HTTP integration test, and test the developer tool PATH (#7178)

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Jack Amadeo
2026-02-13 14:41:18 -05:00
committed by GitHub
parent 0206035dba
commit 5ba5b9899d
17 changed files with 864 additions and 354 deletions
+1 -1
View File
@@ -34,7 +34,7 @@ import RecipeActivities from './recipes/RecipeActivities';
import { useToolCount } from './alerts/useToolCount';
import { getThinkingMessage, getTextAndImageContent } from '../types/message';
import ParameterInputModal from './ParameterInputModal';
import { substituteParameters } from '../utils/providerUtils';
import { substituteParameters } from '../utils/parameterSubstitution';
import { useModelAndProvider } from './ModelAndProviderContext';
import CreateRecipeFromSessionModal from './recipes/CreateRecipeFromSessionModal';
import { toastSuccess } from '../toasts';
@@ -2,12 +2,10 @@ import { describe, it, expect, vi, beforeEach } from 'vitest';
import { render, screen, waitFor, fireEvent } from '@testing-library/react';
import { OllamaSetup } from './OllamaSetup';
import * as ollamaDetection from '../utils/ollamaDetection';
import * as providerUtils from '../utils/providerUtils';
import { toastService } from '../toasts';
// Mock dependencies
vi.mock('../utils/ollamaDetection');
vi.mock('../utils/providerUtils');
vi.mock('../toasts');
// Mock useConfig hook
@@ -162,8 +160,6 @@ describe('OllamaSetup', () => {
});
it('should handle successful connection', async () => {
vi.mocked(providerUtils.initializeSystem).mockResolvedValue(undefined);
render(<OllamaSetup onSuccess={mockOnSuccess} onCancel={mockOnCancel} />);
await waitFor(() => {
@@ -174,20 +170,12 @@ describe('OllamaSetup', () => {
expect(mockUpsert).toHaveBeenCalledWith('GOOSE_PROVIDER', 'ollama', false);
expect(mockUpsert).toHaveBeenCalledWith('GOOSE_MODEL', 'gpt-oss:20b', false);
expect(mockUpsert).toHaveBeenCalledWith('OLLAMA_HOST', 'localhost', false);
expect(providerUtils.initializeSystem).toHaveBeenCalledWith(
'ollama',
'gpt-oss:20b',
expect.any(Object)
);
expect(toastService.success).toHaveBeenCalled();
expect(mockOnSuccess).toHaveBeenCalled();
});
});
it('should handle connection failure', async () => {
const testError = new Error('Initialization failed');
vi.mocked(providerUtils.initializeSystem).mockRejectedValue(testError);
render(<OllamaSetup onSuccess={mockOnSuccess} onCancel={mockOnCancel} />);
await waitFor(() => {
@@ -1,7 +1,7 @@
import { Card } from '../ui/card';
import GooseLogo from '../GooseLogo';
import MarkdownContent from '../MarkdownContent';
import { substituteParameters } from '../../utils/providerUtils';
import { substituteParameters } from '../../utils/parameterSubstitution';
interface RecipeActivitiesProps {
append: (text: string) => void;