mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-27 11:03:27 +01:00
Add raw transcript timestamp tooltips
Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
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();
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user