From 68d28bc5560e121e7d03fd296df9f4f71ec1e3ab Mon Sep 17 00:00:00 2001 From: Luca Rossi Date: Mon, 2 Mar 2026 23:55:57 +0100 Subject: [PATCH] =?UTF-8?q?test:=20add=20asserting=20wikilink=20navigation?= =?UTF-8?q?=20E2E=20test=20=E2=80=94=20screenshot.spec.ts=20test=20had=20n?= =?UTF-8?q?o=20expect()=20calls=20(#180)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Test Co-authored-by: Claude Opus 4.6 Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- e2e/core-flows.spec.ts | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/e2e/core-flows.spec.ts b/e2e/core-flows.spec.ts index 508ce119..e73aefd3 100644 --- a/e2e/core-flows.spec.ts +++ b/e2e/core-flows.spec.ts @@ -231,3 +231,30 @@ test('full create note flow', async ({ page }) => { await page.screenshot({ path: 'test-results/core-create-note.png', fullPage: true }) }) + +// --- Flow 8: Wiki-link navigation --- + +test('clicking a wikilink opens the target note in a new tab', async ({ page }) => { + // Open "Manage Sponsorships" which contains [[Matteo Cellini]] wikilink + await page.locator('.note-list__item', { hasText: 'Manage Sponsorships' }).click() + await page.waitForTimeout(300) + + // Verify we opened the right note + await expect(page.locator('.editor__tab--active')).toHaveText(/Manage Sponsorships/) + + // Click the wikilink — use mouse.click to fire real mousedown + const wikilink = page.locator('.cm-wikilink', { hasText: 'Matteo Cellini' }) + await expect(wikilink).toBeVisible() + const box = await wikilink.boundingBox() + expect(box).not.toBeNull() + await page.mouse.click(box!.x + box!.width / 2, box!.y + box!.height / 2) + await page.waitForTimeout(300) + + // New tab should open with the target note active + await expect(page.locator('.editor__tab--active')).toHaveText(/Matteo Cellini/) + + // Editor should show the target note's content + await expect(page.locator('.cm-content')).toContainText('Matteo Cellini') + + await page.screenshot({ path: 'test-results/core-wikilink-nav.png', fullPage: true }) +})