From a7973e14d93db311e367a60e075d3e87d64aade0 Mon Sep 17 00:00:00 2001 From: Brad Groux Date: Thu, 29 Jan 2026 15:55:23 -0600 Subject: [PATCH] fix: resolve TypeScript build errors in test files - Remove unused React imports in AgentStatusIndicator and WebSocketIndicator tests - Fix Response type cast in api-helpers test (as unknown as Response) --- web/src/__tests__/AgentStatusIndicator.test.tsx | 1 - web/src/__tests__/WebSocketIndicator.test.tsx | 1 - web/src/__tests__/api-helpers.test.ts | 4 ++-- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/web/src/__tests__/AgentStatusIndicator.test.tsx b/web/src/__tests__/AgentStatusIndicator.test.tsx index 6a5843cc..a8643a95 100644 --- a/web/src/__tests__/AgentStatusIndicator.test.tsx +++ b/web/src/__tests__/AgentStatusIndicator.test.tsx @@ -1,7 +1,6 @@ /** * Tests for components/shared/AgentStatusIndicator.tsx — agent status states. */ -import React from 'react'; import { describe, it, expect, vi, afterEach } from 'vitest'; import { render, screen, cleanup } from '@testing-library/react'; import { QueryClient, QueryClientProvider } from '@tanstack/react-query'; diff --git a/web/src/__tests__/WebSocketIndicator.test.tsx b/web/src/__tests__/WebSocketIndicator.test.tsx index b8d0327c..56a0e59f 100644 --- a/web/src/__tests__/WebSocketIndicator.test.tsx +++ b/web/src/__tests__/WebSocketIndicator.test.tsx @@ -1,7 +1,6 @@ /** * Tests for components/shared/WebSocketIndicator.tsx — status indicator states. */ -import React from 'react'; import { describe, it, expect, afterEach } from 'vitest'; import { render, screen, cleanup } from '@testing-library/react'; import { WebSocketStatusProvider } from '@/contexts/WebSocketContext'; diff --git a/web/src/__tests__/api-helpers.test.ts b/web/src/__tests__/api-helpers.test.ts index b27669f6..eaec8cc4 100644 --- a/web/src/__tests__/api-helpers.test.ts +++ b/web/src/__tests__/api-helpers.test.ts @@ -11,7 +11,7 @@ function jsonResponse(body: unknown, status = 200): Response { ok: status >= 200 && status < 300, status, json: async () => body, - } as Response; + } as unknown as Response; } function brokenJsonResponse(status = 200): Response { @@ -21,7 +21,7 @@ function brokenJsonResponse(status = 200): Response { json: async () => { throw new SyntaxError('Unexpected token'); }, - } as Response; + } as unknown as Response; } // ── Tests ────────────────────────────────────────────────────