diff --git a/src/markdown/ir.table-bullets.test.ts b/src/markdown/ir.table-bullets.test.ts index 358cb7eaca9..2cefd1c51de 100644 --- a/src/markdown/ir.table-bullets.test.ts +++ b/src/markdown/ir.table-bullets.test.ts @@ -53,7 +53,7 @@ describe("markdownToIR tableMode bullets", () => { expect(ir.text).toContain("| A | B |"); expect(ir.text).toContain("| 1 | 2 |"); expect(ir.text).not.toContain("•"); - expect(ir.styles.some((style) => style.style === "code_block")).toBe(false); + expect(ir.styles.map((style) => style.style)).not.toContain("code_block"); }); it("handles empty cells gracefully", () => { @@ -81,10 +81,11 @@ describe("markdownToIR tableMode bullets", () => { const ir = markdownToIR(md, { tableMode: "bullets" }); // Should have bold style for row label - const hasRowLabelBold = ir.styles.some( - (s) => s.style === "bold" && ir.text.slice(s.start, s.end) === "Row1", - ); - expect(hasRowLabelBold).toBe(true); + expect( + ir.styles + .filter((style) => style.style === "bold") + .map((style) => ir.text.slice(style.start, style.end)), + ).toContain("Row1"); }); it("renders tables as code blocks in code mode", () => { @@ -98,7 +99,7 @@ describe("markdownToIR tableMode bullets", () => { expect(ir.text).toContain("| A | B |"); expect(ir.text).toContain("| 1 | 2 |"); - expect(ir.styles.some((style) => style.style === "code_block")).toBe(true); + expect(ir.styles.map((style) => style.style)).toContain("code_block"); }); it("preserves inline styles and links in bullets mode", () => { @@ -110,10 +111,11 @@ describe("markdownToIR tableMode bullets", () => { const ir = markdownToIR(md, { tableMode: "bullets" }); - const hasItalic = ir.styles.some( - (s) => s.style === "italic" && ir.text.slice(s.start, s.end) === "Row", - ); - expect(hasItalic).toBe(true); - expect(ir.links.some((link) => link.href === "https://example.com")).toBe(true); + expect( + ir.styles + .filter((style) => style.style === "italic") + .map((style) => ir.text.slice(style.start, style.end)), + ).toContain("Row"); + expect(ir.links.map((link) => link.href)).toContain("https://example.com"); }); }); diff --git a/src/markdown/render-aware-chunking.test.ts b/src/markdown/render-aware-chunking.test.ts index 92b66ca89bc..5481f839554 100644 --- a/src/markdown/render-aware-chunking.test.ts +++ b/src/markdown/render-aware-chunking.test.ts @@ -31,7 +31,7 @@ describe("renderMarkdownIRChunksWithinLimit", () => { expect(chunks.map((chunk) => chunk.source.text)).toEqual(["alpha ", "<<"]); expect(chunks.map((chunk) => chunk.source.text).join("")).toBe("alpha <<"); - expect(chunks.every((chunk) => chunk.rendered.length <= 8)).toBe(true); + expect(chunks.filter((chunk) => chunk.rendered.length > 8)).toEqual([]); }); it("preserves formatting when a rendered chunk is re-split", () => { @@ -46,8 +46,8 @@ describe("renderMarkdownIRChunksWithinLimit", () => { }); expect(chunks.map((chunk) => chunk.source.text)).toEqual(["Which of ", "these"]); - expect(chunks.every((chunk) => chunk.rendered.startsWith(""))).toBe(true); - expect(chunks.every((chunk) => chunk.rendered.endsWith(""))).toBe(true); + expect(chunks.filter((chunk) => !chunk.rendered.startsWith(""))).toEqual([]); + expect(chunks.filter((chunk) => !chunk.rendered.endsWith(""))).toEqual([]); }); it("checks exact candidates instead of assuming rendered length is monotonic", () => {