diff options
| author | Adam Malczewski <[email protected]> | 2026-06-22 11:47:34 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-06-22 11:47:34 +0900 |
| commit | 5d47c500b2a313c9f09a6d8564007a0426de5f22 (patch) | |
| tree | 095f6db688c9940bc9cc2248f21b923b0b7215a5 /src/features/chat/ui.test.ts | |
| parent | 82802a14bc5921c6b62756c3a1a8953c087b5b0d (diff) | |
| download | dispatch-web-5d47c500b2a313c9f09a6d8564007a0426de5f22.tar.gz dispatch-web-5d47c500b2a313c9f09a6d8564007a0426de5f22.zip | |
feat(metrics): show turn number in metrics bubble (turn N · ...)
The turn number comes from the entry's position in the metrics array
(1-based), which is correct regardless of trimming since stepId matching
aligns segments to the right entry. Now displays 'turn 3 · 12k tok' instead
of just 'turn · 12k tok'.
Diffstat (limited to 'src/features/chat/ui.test.ts')
| -rw-r--r-- | src/features/chat/ui.test.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/features/chat/ui.test.ts b/src/features/chat/ui.test.ts index 94db0ae..2891e5b 100644 --- a/src/features/chat/ui.test.ts +++ b/src/features/chat/ui.test.ts @@ -374,7 +374,7 @@ describe("ChatView", () => { expect(screen.getByText("Hello!")).toBeInTheDocument(); expect(screen.getByText(/step 1/)).toBeInTheDocument(); expect(screen.getAllByText(/150 tok/)).toHaveLength(2); - expect(screen.getByText(/turn · 150 tok \(100 in \/ 50 out\)/)).toBeInTheDocument(); + expect(screen.getByText(/turn 1 · 150 tok \(100 in \/ 50 out\)/)).toBeInTheDocument(); expect(screen.getByText(/1\.2s/)).toBeInTheDocument(); }); @@ -478,11 +478,11 @@ describe("ChatView", () => { // Both step-metrics and turn-metrics render expect(screen.getByText(/step 1/)).toBeInTheDocument(); - expect(screen.getByText(/turn · 100 tok/)).toBeInTheDocument(); + expect(screen.getByText(/turn 1 · 100 tok/)).toBeInTheDocument(); // They are in separate elements (different rows) const stepEl = screen.getByText(/step 1 · 100 tok/).closest("div"); - const turnEl = screen.getByText(/turn · 100 tok/).closest("div"); + const turnEl = screen.getByText(/turn 1 · 100 tok/).closest("div"); expect(stepEl).not.toBe(turnEl); }); @@ -556,7 +556,7 @@ describe("ChatView", () => { expect(screen.getByText(/step 1/)).toBeInTheDocument(); expect(screen.getAllByText(/15 tok/)).toHaveLength(2); // Turn metrics rendered - expect(screen.getByText(/turn · 15 tok \(10 in \/ 5 out\)/)).toBeInTheDocument(); + expect(screen.getByText(/turn 1 · 15 tok \(10 in \/ 5 out\)/)).toBeInTheDocument(); // No "null" or "undefined" in the DOM expect(screen.queryByText("null")).toBeNull(); expect(screen.queryByText("undefined")).toBeNull(); |
