Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
478 changes: 431 additions & 47 deletions web-ui/__tests__/components/AgentCard.test.tsx

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Tests for DiscoveryProgress Component (cf-17.2)
* TDD RED Phase - Write tests first
* Migrated from src/components/__tests__/DiscoveryProgress.test.tsx
*/

import { render, screen, waitFor, fireEvent } from '@testing-library/react';
import DiscoveryProgress from '../DiscoveryProgress';
import DiscoveryProgress from '@/components/DiscoveryProgress';
import { projectsApi } from '@/lib/api';
import type { DiscoveryProgressResponse } from '@/types/api';

Expand Down Expand Up @@ -33,7 +33,7 @@ import { authFetch } from '@/lib/api-client';
const mockAuthFetch = authFetch as jest.MockedFunction<typeof authFetch>;

// Mock child components
jest.mock('../ProgressBar', () => {
jest.mock('@/components/ProgressBar', () => {
return function MockProgressBar({ percentage, label }: { percentage: number; label?: string }) {
return (
<div data-testid="mock-progress-bar">
Expand All @@ -44,7 +44,7 @@ jest.mock('../ProgressBar', () => {
};
});

jest.mock('../PhaseIndicator', () => {
jest.mock('@/components/PhaseIndicator', () => {
return function MockPhaseIndicator({ phase }: { phase: string }) {
return <span data-testid="mock-phase-indicator">{phase}</span>;
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/**
* Tests for PRDModal Component
* TDD: RED phase - These tests should fail initially
* Migrated from src/components/PRDModal.test.tsx
*/

import { render, screen } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import PRDModal from './PRDModal';
import PRDModal from '@/components/PRDModal';
import type { PRDResponse } from '@/types/api';

describe('PRDModal', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Tests for PhaseIndicator Component (cf-17.2)
* TDD RED Phase - Write tests first
* Migrated from src/components/__tests__/PhaseIndicator.test.tsx
*/

import { render, screen } from '@testing-library/react';
import PhaseIndicator from '../PhaseIndicator';
import PhaseIndicator from '@/components/PhaseIndicator';

describe('PhaseIndicator Component', () => {
describe('Phase Text Display', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
/**
* Tests for ProgressBar Component (cf-17.2)
* TDD RED Phase - Write tests first
* Migrated from src/components/__tests__/ProgressBar.test.tsx
*/

import { render, screen } from '@testing-library/react';
import ProgressBar from '../ProgressBar';
import ProgressBar from '@/components/ProgressBar';

describe('ProgressBar Component', () => {
describe('Rendering and Width', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/**
* Tests for ProjectCreationForm Component
* Feature: 011-project-creation-flow
* Sprint: 9.5 - Critical UX Fixes
* Migrated from src/components/__tests__/ProjectCreationForm.test.tsx
*/

import React from 'react';
import { render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import ProjectCreationForm from '../ProjectCreationForm';
import ProjectCreationForm from '@/components/ProjectCreationForm';

// Create mock functions
const mockPost = jest.fn();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
/**
* Tests for Spinner Component
* Feature: 011-project-creation-flow (User Story 5)
* Sprint: 9.5 - Critical UX Fixes
* Migrated from src/components/__tests__/Spinner.test.tsx
*/

import React from 'react';
import { render, screen } from '@testing-library/react';
import { Spinner } from '../Spinner';
import { Spinner } from '@/components/Spinner';

describe('Spinner', () => {
test('renders with default medium size', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
/**
* Tests for TaskTreeView Component
* TDD: RED phase - These tests should fail initially
* Migrated from src/components/TaskTreeView.test.tsx
*/

import { render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import TaskTreeView from './TaskTreeView';
import TaskTreeView from '@/components/TaskTreeView';
import type { Issue, Task } from '@/types/api';

// Mock QualityGateStatus component to avoid async issues in tests
jest.mock('./quality-gates/QualityGateStatus', () => {
jest.mock('@/components/quality-gates/QualityGateStatus', () => {
return function QualityGateStatus() {
return 'Quality Gate Status Mock';
};
Expand Down Expand Up @@ -208,7 +208,7 @@ describe('TaskTreeView', () => {
// Use getAllByText since task numbers appear multiple times
const task001Elements = screen.getAllByText(/T-001/i);
expect(task001Elements.length).toBeGreaterThan(0);

const task002Elements = screen.getAllByText(/T-002/i);
expect(task002Elements.length).toBeGreaterThan(0);
});
Expand Down Expand Up @@ -678,4 +678,4 @@ describe('TaskTreeView', () => {
expect(blockedBadges.length).toBe(0);
});
});
});
});
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* Tests for API client methods
* Following TDD methodology - tests written BEFORE implementation
* Migrated from src/lib/__tests__/api.test.ts
*/

import type { ProjectResponse, StartProjectResponse } from '@/types';
Expand Down Expand Up @@ -40,7 +41,7 @@ jest.mock('axios', () => {
});

// Now import the API module after mocking axios
import { projectsApi, blockersApi } from '../api';
import { projectsApi, blockersApi } from '@/lib/api';

beforeEach(() => {
jest.clearAllMocks();
Expand Down
83 changes: 0 additions & 83 deletions web-ui/src/app/__tests__/page.test.tsx

This file was deleted.

Loading
Loading