From 31deb60e859bb326326600dadbfade0807713a07 Mon Sep 17 00:00:00 2001 From: Liu Xiang Qian Date: Mon, 3 Nov 2025 23:20:55 +0800 Subject: [PATCH] fix: Remove unused variables in AITradersPage.test.tsx to fix TypeScript compilation Fixed TypeScript compilation errors by removing unused imports and variables: - Removed unused 'screen' import from test-utils - Removed unused 'fetcher' parameter from SWR mock - Removed unused 'mockTrader' variable - Removed unused 'TraderInfo' type import All tests still pass (5/5) and frontend now compiles successfully. --- web/src/components/AITradersPage.test.tsx | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/web/src/components/AITradersPage.test.tsx b/web/src/components/AITradersPage.test.tsx index 0e17ae50..95d72aad 100644 --- a/web/src/components/AITradersPage.test.tsx +++ b/web/src/components/AITradersPage.test.tsx @@ -1,8 +1,8 @@ import { describe, it, expect, vi, beforeEach } from 'vitest' -import { render, screen, waitFor } from '../test/test-utils' +import { render, waitFor } from '../test/test-utils' import { AITradersPage } from './AITradersPage' import { api } from '../lib/api' -import type { TraderInfo, AIModel, Exchange } from '../types' +import type { AIModel, Exchange } from '../types' // Mock the API module vi.mock('../lib/api', () => ({ @@ -29,7 +29,7 @@ vi.mock('../contexts/LanguageContext', () => ({ // Mock SWR vi.mock('swr', () => ({ - default: (key: string, fetcher: Function) => { + default: (key: string) => { if (key === 'traders') { return { data: [], mutate: vi.fn() } } @@ -79,13 +79,6 @@ describe('AITradersPage - Issue #227 Fix', () => { hyperliquidWalletAddr: '0xtest', } - const mockTrader: TraderInfo = { - trader_id: 'trader-001', - trader_name: 'Test Trader', - ai_model: 'deepseek_chat', - exchange_id: 'binance', - is_running: false, - } beforeEach(() => { vi.clearAllMocks()