fix: extend transcript hover surfaces

This commit is contained in:
Miguel Palhas
2026-09-06 15:26:31 +01:00
parent 22d740a36b
commit b5c9970e28
4 changed files with 36 additions and 28 deletions
+4 -4
View File
@@ -23,6 +23,7 @@ describe("buildTranscriptRow: user/agent/thought", () => {
);
expect(el.className).toContain("st-row-user");
expect(el.textContent).toContain("hi <b>there</b>");
expect(el.querySelector(".st-who")).toBeNull();
// never actual markup from user input
expect(el.querySelector("b")).toBeNull();
});
@@ -61,12 +62,11 @@ describe("buildTranscriptRow: user/agent/thought", () => {
const el = buildTranscriptRow(
row("agent_text", { content: { type: "text", text: "copy **this** exactly" } }),
);
const body = el.querySelector<HTMLElement>(".st-body")!;
expect(body.getAttribute("role")).toBe("button");
body.click();
expect(el.getAttribute("role")).toBe("button");
el.click();
await Promise.resolve();
expect(writeText).toHaveBeenCalledWith("copy **this** exactly");
body.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter", bubbles: true }));
el.dispatchEvent(new KeyboardEvent("keydown", { key: "Enter", bubbles: true }));
await Promise.resolve();
expect(writeText).toHaveBeenCalledTimes(2);
});