Add comprehensive test suite for progress tracking system
Test fixture updates: - Add toolUseId fields (toolu_read1, toolu_edit1) to tool_use blocks - Add parentToolUseID-linked progress events for read and edit tools - Add orphaned SessionStart progress event (no parent) - Update tool_result references to match new toolUseId values - Add bash_progress and mcp_progress subtypes for subtype derivation session-parser tests (7 new): - toolUseId extraction from tool_use blocks with and without id field - parentToolUseId and progressSubtype extraction from hook_progress - Subtype derivation for bash_progress, mcp_progress, agent_progress - Fallback to "hook" for unknown data types - Undefined parentToolUseId when field is absent progress-grouper tests (7 new): - Partition parented progress into toolProgress map - Remove parented progress from filtered messages array - Keep orphaned progress (no parentToolUseId) in main stream - Keep progress with invalid parentToolUseId (no matching tool_call) - Empty input handling - Sort each group by rawIndex - Multiple tool_call parents tracked independently agent-progress-parser tests (full suite): - Parse user text events with prompt/agentId metadata extraction - Parse tool_use blocks into AgentToolCall events - Parse tool_result blocks with content extraction - Parse text content as text_response with line counting - Handle multiple content blocks in single turn - Post-pass tool_result→tool_call linking (sourceTool, language) - Empty input and malformed JSON → raw_content fallback - stripLineNumbers for cat-n prefixed output - summarizeToolCall for Read, Grep, Glob, Bash, Task, WarpGrep, etc. ProgressBadge component tests: - Collapsed state shows pill counts, hides content - Expanded state shows all event content via markdown - Subtype counting accuracy - Agent-only events route to AgentProgressView AgentProgressView component tests: - Prompt banner rendering with truncation - Agent ID and turn count display - Summary rows with timestamps and tool names - Click-to-expand drill-down content html-exporter tests (8 new): - Collapsible rendering for thinking, tool_call, tool_result - Toggle button and JavaScript inclusion - Non-collapsible messages lack collapse attributes - Diff content detection and highlighting - Progress badge rendering with toolProgress data filters tests (2 new): - hook_progress included/excluded by category toggle Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -112,6 +112,19 @@ describe("filters", () => {
|
||||
expect(filtered.every((m) => m.category === "tool_call" || m.category === "tool_result")).toBe(true);
|
||||
});
|
||||
|
||||
it("hook_progress included when category is enabled", () => {
|
||||
const enabled = new Set<MessageCategory>(ALL_CATEGORIES);
|
||||
const filtered = filterMessages(messages, enabled);
|
||||
expect(filtered.find((m) => m.category === "hook_progress")).toBeDefined();
|
||||
});
|
||||
|
||||
it("hook_progress excluded when category is disabled", () => {
|
||||
const enabled = new Set<MessageCategory>(ALL_CATEGORIES);
|
||||
enabled.delete("hook_progress");
|
||||
const filtered = filterMessages(messages, enabled);
|
||||
expect(filtered.find((m) => m.category === "hook_progress")).toBeUndefined();
|
||||
});
|
||||
|
||||
it("category counts are computed correctly", () => {
|
||||
const counts: Record<string, number> = {};
|
||||
for (const cat of ALL_CATEGORIES) {
|
||||
|
||||
Reference in New Issue
Block a user