refactor: remove old test files for useProxyHosts and useRemoteServers; add new tests for useImport and update existing tests for useProxyHosts and useRemoteServers

This commit is contained in:
Wikid82
2025-11-19 20:22:01 -05:00
parent 2f0058083e
commit 21eb2d2608
4 changed files with 10 additions and 5 deletions

View File

@@ -4,11 +4,16 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import ProxyHostForm from '../ProxyHostForm'
import { mockRemoteServers } from '../../test/mockData'
// Mock the API
vi.mock('../../services/api', () => ({
remoteServersAPI: {
list: vi.fn(() => Promise.resolve(mockRemoteServers)),
},
// Mock the hook
vi.mock('../../hooks/useRemoteServers', () => ({
useRemoteServers: vi.fn(() => ({
servers: mockRemoteServers,
isLoading: false,
error: null,
createRemoteServer: vi.fn(),
updateRemoteServer: vi.fn(),
deleteRemoteServer: vi.fn(),
})),
}))
const queryClient = new QueryClient({