test(frontend): update tests for type changes
Update all test files to use correct enum values: - AgentPanel, AgentStatusIndicator tests - ProjectHeader, StatusBadge tests - IssueSummary, IssueTable tests - StatusBadge, StatusWorkflow tests (issues) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -8,12 +8,6 @@ describe('AgentStatusIndicator', () => {
|
||||
expect(indicator).toHaveClass('bg-yellow-500');
|
||||
});
|
||||
|
||||
it('renders active status with correct color', () => {
|
||||
const { container } = render(<AgentStatusIndicator status="active" />);
|
||||
const indicator = container.querySelector('span > span');
|
||||
expect(indicator).toHaveClass('bg-green-500');
|
||||
});
|
||||
|
||||
it('renders working status with animation', () => {
|
||||
const { container } = render(<AgentStatusIndicator status="working" />);
|
||||
const indicator = container.querySelector('span > span');
|
||||
@@ -21,16 +15,16 @@ describe('AgentStatusIndicator', () => {
|
||||
expect(indicator).toHaveClass('animate-pulse');
|
||||
});
|
||||
|
||||
it('renders pending status with correct color', () => {
|
||||
const { container } = render(<AgentStatusIndicator status="pending" />);
|
||||
it('renders waiting status with correct color', () => {
|
||||
const { container } = render(<AgentStatusIndicator status="waiting" />);
|
||||
const indicator = container.querySelector('span > span');
|
||||
expect(indicator).toHaveClass('bg-gray-400');
|
||||
expect(indicator).toHaveClass('bg-blue-500');
|
||||
});
|
||||
|
||||
it('renders error status with correct color', () => {
|
||||
const { container } = render(<AgentStatusIndicator status="error" />);
|
||||
it('renders paused status with correct color', () => {
|
||||
const { container } = render(<AgentStatusIndicator status="paused" />);
|
||||
const indicator = container.querySelector('span > span');
|
||||
expect(indicator).toHaveClass('bg-red-500');
|
||||
expect(indicator).toHaveClass('bg-gray-400');
|
||||
});
|
||||
|
||||
it('renders terminated status with correct color', () => {
|
||||
@@ -40,41 +34,41 @@ describe('AgentStatusIndicator', () => {
|
||||
});
|
||||
|
||||
it('applies small size by default', () => {
|
||||
const { container } = render(<AgentStatusIndicator status="active" />);
|
||||
const { container } = render(<AgentStatusIndicator status="working" />);
|
||||
const indicator = container.querySelector('span > span');
|
||||
expect(indicator).toHaveClass('h-2', 'w-2');
|
||||
});
|
||||
|
||||
it('applies medium size when specified', () => {
|
||||
const { container } = render(<AgentStatusIndicator status="active" size="md" />);
|
||||
const { container } = render(<AgentStatusIndicator status="working" size="md" />);
|
||||
const indicator = container.querySelector('span > span');
|
||||
expect(indicator).toHaveClass('h-3', 'w-3');
|
||||
});
|
||||
|
||||
it('applies large size when specified', () => {
|
||||
const { container } = render(<AgentStatusIndicator status="active" size="lg" />);
|
||||
const { container } = render(<AgentStatusIndicator status="working" size="lg" />);
|
||||
const indicator = container.querySelector('span > span');
|
||||
expect(indicator).toHaveClass('h-4', 'w-4');
|
||||
});
|
||||
|
||||
it('shows label when showLabel is true', () => {
|
||||
render(<AgentStatusIndicator status="active" showLabel />);
|
||||
expect(screen.getByText('Active')).toBeInTheDocument();
|
||||
render(<AgentStatusIndicator status="working" showLabel />);
|
||||
expect(screen.getByText('Working')).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('does not show label by default', () => {
|
||||
render(<AgentStatusIndicator status="active" />);
|
||||
expect(screen.queryByText('Active')).not.toBeInTheDocument();
|
||||
render(<AgentStatusIndicator status="working" />);
|
||||
expect(screen.queryByText('Working')).not.toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('has accessible status role and label', () => {
|
||||
render(<AgentStatusIndicator status="active" />);
|
||||
expect(screen.getByRole('status')).toHaveAttribute('aria-label', 'Status: Active');
|
||||
render(<AgentStatusIndicator status="working" />);
|
||||
expect(screen.getByRole('status')).toHaveAttribute('aria-label', 'Status: Working');
|
||||
});
|
||||
|
||||
it('applies custom className', () => {
|
||||
const { container } = render(
|
||||
<AgentStatusIndicator status="active" className="custom-class" />
|
||||
<AgentStatusIndicator status="working" className="custom-class" />
|
||||
);
|
||||
expect(container.firstChild).toHaveClass('custom-class');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user