From 89002017c1700b53cfbc23b7b60546916e226cf9 Mon Sep 17 00:00:00 2001 From: Jonatan Heyman Date: Mon, 16 Jun 2025 14:20:17 +0200 Subject: [PATCH] Add test fold folding a block --- tests/folding.spec.js | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/folding.spec.js b/tests/folding.spec.js index 8072131..0bc85f2 100644 --- a/tests/folding.spec.js +++ b/tests/folding.spec.js @@ -65,4 +65,20 @@ This is a markdown block const content = await heynotePage.getContent() expect(content).toContain("abc test") }); + + test("block can be folded", async ({ page }) => { + // Position cursor in first block (which has multiple lines) + await heynotePage.setCursorPosition(20) // Middle of Block A + + // Verify no fold placeholder exists initially + await expect(page.locator(".cm-foldPlaceholder")).not.toBeVisible() + + // Fold block using keyboard shortcut + const foldKey = heynotePage.isMac ? "Alt+Meta+[" : "Ctrl+Shift+[" + await page.locator("body").press(foldKey) + await page.waitForTimeout(100) + + // Verify block is folded by checking for fold placeholder + await expect(page.locator(".cm-foldPlaceholder")).toBeVisible() + }); }); \ No newline at end of file