mirror of
https://github.com/NoFxAiOS/nofx.git
synced 2026-07-14 08:16:56 +08:00
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.
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
import { describe, it, expect, vi, beforeEach } from 'vitest'
|
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 { AITradersPage } from './AITradersPage'
|
||||||
import { api } from '../lib/api'
|
import { api } from '../lib/api'
|
||||||
import type { TraderInfo, AIModel, Exchange } from '../types'
|
import type { AIModel, Exchange } from '../types'
|
||||||
|
|
||||||
// Mock the API module
|
// Mock the API module
|
||||||
vi.mock('../lib/api', () => ({
|
vi.mock('../lib/api', () => ({
|
||||||
@@ -29,7 +29,7 @@ vi.mock('../contexts/LanguageContext', () => ({
|
|||||||
|
|
||||||
// Mock SWR
|
// Mock SWR
|
||||||
vi.mock('swr', () => ({
|
vi.mock('swr', () => ({
|
||||||
default: (key: string, fetcher: Function) => {
|
default: (key: string) => {
|
||||||
if (key === 'traders') {
|
if (key === 'traders') {
|
||||||
return { data: [], mutate: vi.fn() }
|
return { data: [], mutate: vi.fn() }
|
||||||
}
|
}
|
||||||
@@ -79,13 +79,6 @@ describe('AITradersPage - Issue #227 Fix', () => {
|
|||||||
hyperliquidWalletAddr: '0xtest',
|
hyperliquidWalletAddr: '0xtest',
|
||||||
}
|
}
|
||||||
|
|
||||||
const mockTrader: TraderInfo = {
|
|
||||||
trader_id: 'trader-001',
|
|
||||||
trader_name: 'Test Trader',
|
|
||||||
ai_model: 'deepseek_chat',
|
|
||||||
exchange_id: 'binance',
|
|
||||||
is_running: false,
|
|
||||||
}
|
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
vi.clearAllMocks()
|
vi.clearAllMocks()
|
||||||
|
|||||||
Reference in New Issue
Block a user