diff --git a/packages/coding-agent/test/read-summary.test.ts b/packages/coding-agent/test/read-summary.test.ts index 6a2080860..527e727ea 100644 --- a/packages/coding-agent/test/read-summary.test.ts +++ b/packages/coding-agent/test/read-summary.test.ts @@ -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.");