Add raw transcript timestamp tooltips

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-04-24 13:32:06 -05:00
1 parent 89b94da25b
commit d72b693fd6
2 files changed
+39 -3

No files matched your search

@@ -1,6 +1,6 @@
// @vitest-environment node
import { describe, expect, it } from "vitest";
import { describe, expect, it, vi } from "vitest";
import { renderToStaticMarkup } from "react-dom/server";
import type { TranscriptEntry } from "../../adapters";
import { ThemeProvider } from "../../context/ThemeContext";
@@ -110,4 +110,31 @@ describe("RunTranscriptView", () => {
expect(html).toMatch(/<li[^>]*>posted issue update<\/li>/);
expect(html).not.toContain("result");
});
it("adds timestamp and age tooltip to raw mode labels", () => {
vi.useFakeTimers();
vi.setSystemTime(new Date("2026-03-12T00:03:00.000Z"));
try {
const html = renderToStaticMarkup(
<ThemeProvider>
<RunTranscriptView
mode="raw"
entries={[
{
kind: "stdout",
ts: "2026-03-12T00:00:00.000Z",
text: "hello",
},
]}
/>
</ThemeProvider>,
);
expect(html).toContain("Timestamp:");
expect(html).toContain("Ago: 3m ago");
expect(html).toContain(">stdout</span>");
} finally {
vi.useRealTimers();
}
});
});