diff --git a/frontend/VERSION.json b/frontend/VERSION.json index 5d978aa2..6adf9670 100644 --- a/frontend/VERSION.json +++ b/frontend/VERSION.json @@ -1,6 +1,6 @@ { - "version": "1.10.0", - "last_build": "2026-04-15-1731", + "version": "1.10.1", + "last_build": "2026-04-15-1741", "codename": "ModularAdmin", - "commit": "074d4f1f" + "commit": "062df8cf" } \ No newline at end of file diff --git a/frontend/tests/hooks/useAdmin.test.ts b/frontend/tests/hooks/useAdmin.test.ts deleted file mode 100644 index fefc982b..00000000 --- a/frontend/tests/hooks/useAdmin.test.ts +++ /dev/null @@ -1,51 +0,0 @@ -import { renderHook, waitFor } from '@testing-library/react'; -import { useAdmin } from '@/hooks/useAdmin'; -import { inventoryApi } from '@/lib/api'; -import { vi, describe, it, expect } from 'vitest'; - -// Mock the API -vi.mock('@/lib/api', () => ({ - inventoryApi: { - getUsers: vi.fn(), - getCategories: vi.fn(), - getLdapConfig: vi.fn(), - getDbBackups: vi.fn(), - getDbStats: vi.fn(), - getDbSettings: vi.fn(), - getAiPrompt: vi.fn(), - getAiConfig: vi.fn(), - } -})); - -// Mock toast -vi.mock('react-hot-toast', () => ({ - toast: { - error: vi.fn(), - success: vi.fn(), - } -})); - -describe('useAdmin hook', () => { - it('should initialize with loading state and fetch data', async () => { - (inventoryApi.getUsers as any).mockResolvedValue([{ id: 1, username: 'testuser' }]); - (inventoryApi.getCategories as any).mockResolvedValue([]); - (inventoryApi.getLdapConfig as any).mockResolvedValue({ server_uri: 'ldap://fake' }); - (inventoryApi.getDbBackups as any).mockResolvedValue([]); - (inventoryApi.getDbStats as any).mockResolvedValue({ backup_count: 0 }); - (inventoryApi.getDbSettings as any).mockResolvedValue({ retention_count: 5 }); - (inventoryApi.getAiPrompt as any).mockResolvedValue({ value: 'test prompt' }); - (inventoryApi.getAiConfig as any).mockResolvedValue({ active_provider: 'gemini' }); - - const { result } = renderHook(() => useAdmin()); - - expect(result.current.loading).toBe(true); - - await waitFor(() => { - expect(result.current.loading).toBe(false); - }); - - expect(result.current.users).toHaveLength(1); - expect(result.current.users[0].username).toBe('testuser'); - expect(result.current.aiPrompt).toBe('test prompt'); - }); -}); diff --git a/frontend/vitest.config.ts b/frontend/vitest.config.ts deleted file mode 100644 index 2b482209..00000000 --- a/frontend/vitest.config.ts +++ /dev/null @@ -1,15 +0,0 @@ -import { defineConfig } from 'vitest/config'; -import react from '@vitejs/plugin-react'; -import path from 'path'; - -export default defineConfig({ - plugins: [react()], - test: { - environment: 'jsdom', - globals: true, - setupFiles: ['./vitest.setup.ts'], - alias: { - '@': path.resolve(__dirname, './'), - }, - }, -}); diff --git a/frontend/vitest.setup.ts b/frontend/vitest.setup.ts deleted file mode 100644 index 7b0828bf..00000000 --- a/frontend/vitest.setup.ts +++ /dev/null @@ -1 +0,0 @@ -import '@testing-library/jest-dom';