From f9149eba13a101d23f148586461850525182a0dd Mon Sep 17 00:00:00 2001 From: Claude Opus 5 Date: Sat, 1 Aug 2026 11:29:54 +0200 Subject: [PATCH] #302: the vault import test reaches its page through the sidebar MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The Obsidian fixture vault contains a note called "Startseite", and the pond now creates one too — the seeded fixtures use locale `de`. Two consequences, and the second is the one that mattered: - the unscoped title locator matched two sidebar entries; - `/p//startseite` no longer belongs to the imported note. The pond's own start page took that slug, so the import landed on a suffixed one and the test was about to assert against the wrong page. Both are fixed by scoping to the mount page and navigating through the sidebar instead of guessing a slug. The test stays meaningful: it then clicks a wikilink inside the page content, which the empty auto-created start page would not have. CI caught this; the local run passed it. Worth remembering that a title-based locator can go green by luck. --- apps/web/e2e/import-vault.spec.ts | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/apps/web/e2e/import-vault.spec.ts b/apps/web/e2e/import-vault.spec.ts index d0d05f8..1533f31 100644 --- a/apps/web/e2e/import-vault.spec.ts +++ b/apps/web/e2e/import-vault.spec.ts @@ -93,11 +93,19 @@ test('a pond admin imports an Obsidian vault through the settings dialog', async await expect( mountItem.locator('.sidebar__tree-children .sidebar__page', { hasText: 'Projekte' }), ).toBeVisible(); - await expect(page.locator('.sidebar__page:text-is("Startseite")')).toBeVisible(); + // Scoped to the mount: the pond has its own "Startseite" since issue #302, + // so an unscoped title match now finds two entries. + const importedHome = mountItem + .locator('.sidebar__tree-children .sidebar__page') + .filter({ hasText: /^Startseite$/ }) + .first(); + await expect(importedHome).toBeVisible(); // A rewritten Obsidian link navigates to the right imported page, and the - // display text still reads like the original note name. - await page.goto(`/p/${pond.slug}/startseite`); + // display text still reads like the original note name. Reached through the + // sidebar rather than by slug — `/startseite` belongs to the pond's own + // start page, so the imported note landed on a suffixed slug. + await importedHome.click(); await page.locator('.editor-content a.wikilink', { hasText: 'Projekt A' }).click(); await expect(page).toHaveURL(new RegExp(`/p/${pond.slug}/projekt-a$`));