test: anchor live canvas preview

This commit is contained in:
Shakker
2026-05-12 16:31:39 +01:00
parent 19a70d98b1
commit 2174cabcbe

View File

@@ -1696,9 +1696,14 @@ describe("grouped chat rendering", () => {
const allPreviews = container.querySelectorAll(".chat-tool-card__preview-frame");
expect(allPreviews).toHaveLength(1);
const bubble = expectElement(container, ".chat-group.assistant .chat-bubble", HTMLElement);
expectElement(bubble, ".chat-tool-card__preview-frame", HTMLIFrameElement);
expect(bubble.textContent).toContain("This item is ready.");
expect(bubble.textContent).toContain("Live history preview");
const iframe = expectElement(bubble, ".chat-tool-card__preview-frame", HTMLIFrameElement);
expect(iframe.getAttribute("src")).toBe(
"/__openclaw__/canvas/documents/cv_canvas_live_history/index.html",
);
expect(bubble.querySelector(".chat-text")?.textContent?.trim()).toBe("This item is ready.");
expect(bubble.querySelector(".chat-tool-card__preview-label")?.textContent?.trim()).toBe(
"Live history preview",
);
});
it("renders hidden assistant_message canvas results with the configured sandbox", () => {