wip: complete rework first round

This commit is contained in:
2026-02-26 09:27:22 +01:00
parent c70f4b9154
commit affd62ca79
78 changed files with 2635 additions and 4053 deletions

View File

@@ -15,7 +15,6 @@ describe('AssistantSidebar wiring', () => {
validateApiKey: vi.fn(),
setApiKey: vi.fn(),
getApiKey: vi.fn(),
getProtocolHealth: vi.fn(),
getAvailableModels: vi.fn(),
setDefaultModel: vi.fn(),
getSystemPrompt: vi.fn(),
@@ -37,6 +36,8 @@ describe('AssistantSidebar wiring', () => {
onToolCall,
onToolResult,
onTitleUpdated,
onA2UIMessage: vi.fn(() => vi.fn()),
dispatchA2UIAction: vi.fn(),
} as never;
});

View File

@@ -55,18 +55,7 @@ describe('Editor dashboard timeline', () => {
]);
(window as any).electronAPI.posts.getTagsWithCounts = vi.fn().mockResolvedValue([]);
(window as any).electronAPI.posts.getCategoriesWithCounts = vi.fn().mockResolvedValue([]);
(window as any).electronAPI.chat = {
getProtocolHealth: vi.fn().mockResolvedValue({
totalTurns: 10,
validEnvelopeTurns: 9,
repairAttempts: 1,
fallbackTurns: 0,
blockedActionCount: 2,
parseValidityRate: 0.9,
repairRate: 0.1,
fallbackRate: 0,
}),
};
(window as any).electronAPI.chat = {};
(window as any).electronAPI.tags = {
getAll: vi.fn().mockResolvedValue([]),
};
@@ -94,17 +83,4 @@ describe('Editor dashboard timeline', () => {
expect(screen.getByText('2024')).toBeInTheDocument();
});
it('renders protocol telemetry stats in dashboard', async () => {
render(<Editor />);
await act(async () => {
await Promise.resolve();
await Promise.resolve();
await Promise.resolve();
});
expect(screen.getByText('90%')).toBeInTheDocument();
expect(screen.getByText('2 blocked actions')).toBeInTheDocument();
});
});