Files
PaperClipAI/tests/runner-e2e/task-reply-content.test.ts
T
DottaandPaperclip 6677515cf3 Fix rendered Markdown reply evidence in product journeys
Match full visible content and exact link destinations while retaining source Markdown and native run attribution. Preserve the original browser regression and strengthen decline source checks.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-10-29 23:07:30 -05:00

15 lines
817 B
TypeScript

import { expect, it } from "vitest";
import { taskReplyContentMatches } from "./task-reply-content.js";
it("parses CommonMark escapes, entities, inline formatting and paragraph boundaries", () => {
expect(taskReplyContentMatches({ body: "Couldn't retrieve a_b & c. No retry." },
"**Couldn't retrieve** `a_b` &amp; c.\n\nNo _retry_.")).toBe(true);
expect(taskReplyContentMatches({ body: "Couldn't retrieve a_b & c. No retry. Extra." },
"**Couldn't retrieve** `a_b` &amp; c.\n\nNo _retry_.")).toBe(false);
});
it("rejects unsupported Markdown rather than stripping unknown or invisible content", () => {
for (const source of ["Visible <!-- hidden -->", "Visible ![image](https://fixture.test/image.png)", "~~Visible~~"])
expect(taskReplyContentMatches({ body: "Visible" }, source)).toBe(false);
});