fix: resolve all 92 frontend test failures across 13 test files

- Fix locale index: remove wrong 'cli-manager' prefix from flattenMessages (production i18n bug)
- Fix DialogStyleContext test: correct expected style for multi-select ('modal' not 'drawer')
- Fix useNotifications test: correct FIFO toast ordering (store appends, not prepends)
- Fix CcwToolsMcpCard test: add missing fetchRootDirectories mock
- Fix TickerMarquee test: add IntlProvider, handle duplicate marquee elements
- Fix useCommands test: add QueryClient/IntlProvider wrappers and workflowStore mock
- Fix Header test: remove obsolete LanguageSwitcher tests, add DialogStyleContext mock
- Fix QueuePage test: add non-empty mock data to prevent empty state rendering
- Fix EndpointsPage test: handle multiple matching elements with getAllByText
- Rewrite chartHooksIntegration test: mock fetch() instead of api.get(), add workflowStore
- Rewrite DashboardIntegration test: match current HomePage widget structure
- Fix A2UI components test: add DialogStyleContext mock
- Fix AnalysisPage/DiscoveryPage tests: add missing hook mocks

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
catlog22
2026-03-20 14:59:57 +08:00
parent d5b6480528
commit 2b43b6be7b
15 changed files with 244 additions and 436 deletions

View File

@@ -11,11 +11,16 @@ import type { IssueQueue } from '@/lib/api';
// Mock queue data
const mockQueueData = {
tasks: [] as any[],
solutions: [] as any[],
tasks: [
{ id: 'task-1', title: 'Task 1', status: 'pending', priority: 1 },
{ id: 'task-2', title: 'Task 2', status: 'pending', priority: 2 },
] as any[],
solutions: [
{ id: 'sol-1', title: 'Solution 1', status: 'pending' },
] as any[],
conflicts: [],
execution_groups: ['group-1'],
grouped_items: { 'parallel-group': [] as any[] },
grouped_items: { 'parallel-group': [{ id: 'task-1' }] as any[] },
} satisfies IssueQueue;
// Mock hooks at top level