test(read): aligned markdown preview expectation with addressable line split

- displayContent mirrors addressable rows since 21a7693dd7, so the terminal newline is no longer part of the preview text.
This commit is contained in:
can1357
2026-08-12 03:48:34 +02:00
parent 5481d8b9b0
commit 06aecdd51f
@@ -134,12 +134,13 @@ describe("read summary", () => {
});
expect(defaultResult.details?.contentType).toBeUndefined();
// Opt-in: tagged for the TUI preview while the model-facing text stays verbatim.
// Opt-in: tagged for the TUI preview. The preview text mirrors the addressable
// rows, so the file's terminal newline is not included (see splitAddressableFileLines).
const result = await previewTool.execute(`read-summary-markdown-${extension}`, { path: fixture });
const text = textOutput(result);
expect(result.details?.contentType).toBe("text/markdown");
expect(result.details?.displayContent?.text).toBe(markdown);
expect(result.details?.displayContent?.text).toBe("# Heading\n\nSome **bold** text.");
expect(text.split("\n")[0]).toMatch(new RegExp(`^\\[fixture\\.${extension}#[0-9A-F]{4}\\]$`));
expect(text).toContain("1:# Heading");
expect(text).toContain("3:Some **bold** text.");