From 088c495520191dc040db5bed3ce8c0e5b5c2489a Mon Sep 17 00:00:00 2001 From: Test Date: Thu, 12 Mar 2026 00:20:23 +0100 Subject: [PATCH] fix: use note-list-container scoped selector in reopen-closed-tab smoke test The bare `.cursor-pointer.border-b` selector was unreliable in the pre-push Playwright environment. Use `[data-testid="note-list-container"]` to scope the note click, matching the pattern used by other passing tests. Co-Authored-By: Claude Opus 4.6 --- tests/smoke/reopen-closed-tab.spec.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/tests/smoke/reopen-closed-tab.spec.ts b/tests/smoke/reopen-closed-tab.spec.ts index 9538bc3c..d478c76c 100644 --- a/tests/smoke/reopen-closed-tab.spec.ts +++ b/tests/smoke/reopen-closed-tab.spec.ts @@ -15,20 +15,22 @@ const TAB = '[data-tab-path]' test.describe('Reopen closed tab (Cmd+Shift+T)', () => { test.beforeEach(async ({ page }) => { + await page.setViewportSize({ width: 1600, height: 900 }) await page.goto('/') - await page.evaluate(() => localStorage.removeItem('laputa-tab-order')) - await page.reload() await page.waitForLoadState('networkidle') }) test('open note → close tab → Cmd+Shift+T → tab reopens', async ({ page }) => { - const firstNote = page.locator('.cursor-pointer.border-b').first() - await expect(firstNote).toBeVisible() + // Open the first note via the sidebar + const noteListContainer = page.locator('[data-testid="note-list-container"]') + await noteListContainer.waitFor({ timeout: 5000 }) + const firstNote = noteListContainer.locator('.cursor-pointer.border-b').first() + await expect(firstNote).toBeVisible({ timeout: 5000 }) await firstNote.click() await page.waitForTimeout(500) const tabs = page.locator(TAB) - await expect(tabs.first()).toBeVisible({ timeout: 3000 }) + await expect(tabs.first()).toBeVisible({ timeout: 5000 }) const tabTitle = await tabs.first().textContent() // Close the tab via its close button