From e64dd7b56ab5acb168e33c95c8f324c482accc10 Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Mon, 16 Feb 2026 00:42:13 +0000 Subject: [PATCH] perf(test): fold markdown list spacing into nested lists suite --- src/markdown/ir.list-spacing.test.ts | 33 ---------------------------- src/markdown/ir.nested-lists.test.ts | 31 ++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 33 deletions(-) delete mode 100644 src/markdown/ir.list-spacing.test.ts diff --git a/src/markdown/ir.list-spacing.test.ts b/src/markdown/ir.list-spacing.test.ts deleted file mode 100644 index 56a8b3f17..000000000 --- a/src/markdown/ir.list-spacing.test.ts +++ /dev/null @@ -1,33 +0,0 @@ -import { describe, it, expect } from "vitest"; -import { markdownToIR } from "./ir.js"; - -describe("list paragraph spacing", () => { - it("adds blank line between bullet list and following paragraph", () => { - const input = `- item 1 -- item 2 - -Paragraph after`; - const result = markdownToIR(input); - // Should have two newlines between "item 2" and "Paragraph" - expect(result.text).toContain("item 2\n\nParagraph"); - }); - - it("adds blank line between ordered list and following paragraph", () => { - const input = `1. item 1 -2. item 2 - -Paragraph after`; - const result = markdownToIR(input); - expect(result.text).toContain("item 2\n\nParagraph"); - }); - - it("does not produce triple newlines", () => { - const input = `- item 1 -- item 2 - -Paragraph after`; - const result = markdownToIR(input); - // Should NOT have three consecutive newlines - expect(result.text).not.toContain("\n\n\n"); - }); -}); diff --git a/src/markdown/ir.nested-lists.test.ts b/src/markdown/ir.nested-lists.test.ts index 4ca4e9bd9..7de8931eb 100644 --- a/src/markdown/ir.nested-lists.test.ts +++ b/src/markdown/ir.nested-lists.test.ts @@ -299,3 +299,34 @@ describe("Nested Lists - Edge Cases", () => { expect(result.text).toBe(expected); }); }); + +describe("list paragraph spacing", () => { + it("adds blank line between bullet list and following paragraph", () => { + const input = `- item 1 +- item 2 + +Paragraph after`; + const result = markdownToIR(input); + // Should have two newlines between "item 2" and "Paragraph" + expect(result.text).toContain("item 2\n\nParagraph"); + }); + + it("adds blank line between ordered list and following paragraph", () => { + const input = `1. item 1 +2. item 2 + +Paragraph after`; + const result = markdownToIR(input); + expect(result.text).toContain("item 2\n\nParagraph"); + }); + + it("does not produce triple newlines", () => { + const input = `- item 1 +- item 2 + +Paragraph after`; + const result = markdownToIR(input); + // Should NOT have three consecutive newlines + expect(result.text).not.toContain("\n\n\n"); + }); +});