diff --git a/extensions/matrix/src/matrix/format.test.ts b/extensions/matrix/src/matrix/format.test.ts
index ab1990a67fb..e4e5a625405 100644
--- a/extensions/matrix/src/matrix/format.test.ts
+++ b/extensions/matrix/src/matrix/format.test.ts
@@ -10,83 +10,71 @@ function createMentionClient(selfUserId = "@bot:example.org") {
describe("markdownToMatrixHtml", () => {
it("renders basic inline formatting", () => {
const html = markdownToMatrixHtml("hi _there_ **boss** `code`");
- expect(html).toContain("there");
- expect(html).toContain("boss");
- expect(html).toContain("code");
+ expect(html).toBe("
hi there boss code
see docs
'); }); it("does not auto-link bare file references into external urls", () => { const html = markdownToMatrixHtml("Check README.md and backup.sh"); - expect(html).toContain("README.md"); - expect(html).toContain("backup.sh"); - expect(html).not.toContain('href="http://README.md"'); - expect(html).not.toContain('href="http://backup.sh"'); + expect(html).toBe("Check README.md and backup.sh
"); }); it("keeps real domains linked even when path segments look like filenames", () => { const html = markdownToMatrixHtml("See https://docs.example.com/backup.sh"); - expect(html).toContain('href="https://docs.example.com/backup.sh"'); + expect(html).toBe( + 'See https://docs.example.com/backup.sh
', + ); }); it("escapes raw HTML", () => { const html = markdownToMatrixHtml("nope"); - expect(html).toContain("<b>nope</b>"); - expect(html).not.toContain("nope"); + expect(html).toBe("<b>nope</b>
"); }); it("flattens images into alt text", () => { const html = markdownToMatrixHtml(""); - expect(html).toContain("alt"); - expect(html).not.toContain(""); + expect(html).toBe("
"); + expect(html).toBe("
"); + expect(html).toBe("
"); + expect(html).toBe("
Hello
"); - expect(html).toContain("World
"); + expect(html).toBe("Hello
\nWorld
"); }); it("compacts nested sublists without paragraph tags", () => { const html = markdownToMatrixHtml("1. parent\n\n - child\n\n2. other"); - expect(html).toContain(""); + expect(html).toBe( + "
First sentence.
"); - expect(html).toContain("Second sentence in the same item.
"); + expect(html).toBe( + "First sentence.
\nSecond sentence in the same item.
\n