From e1e489fbc7d12b73357d00daa840e9cd44553e5d Mon Sep 17 00:00:00 2001 From: Test Date: Wed, 18 Mar 2026 21:51:56 +0100 Subject: [PATCH] fix: make snippet smoke test selector more specific The generic .text-muted-foreground selector matched metadata elements instead of the actual snippet div. Use .text-[12px] qualifier to target only snippet elements. Co-Authored-By: Claude Opus 4.6 (1M context) --- tests/smoke/note-list-preview-snippet.spec.ts | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/smoke/note-list-preview-snippet.spec.ts b/tests/smoke/note-list-preview-snippet.spec.ts index 5825fe3a..ec7db281 100644 --- a/tests/smoke/note-list-preview-snippet.spec.ts +++ b/tests/smoke/note-list-preview-snippet.spec.ts @@ -15,18 +15,13 @@ test.describe('Note list preview snippet', () => { await expect(noteItems.first()).toBeVisible({ timeout: 5000 }) // Each note item has a snippet div: 12px text with muted-foreground - // Check that at least one note has text content in its snippet area - const snippets = noteListContainer.locator('.text-muted-foreground') - const count = await snippets.count() - let foundSnippet = false - for (let i = 0; i < count; i++) { - const text = await snippets.nth(i).textContent() - if (text && text.length > 15 && !/^\d/.test(text.trim())) { - foundSnippet = true - break - } - } - expect(foundSnippet).toBe(true) + // Use the specific text-[12px] class to target snippet divs, not metadata + const snippetSelector = '.text-\\[12px\\].text-muted-foreground' + const snippet = noteListContainer.locator(snippetSelector).first() + await expect(snippet).toBeVisible({ timeout: 5000 }) + + const text = await snippet.textContent() + expect(text && text.length > 10).toBe(true) }) test('snippet does not contain raw markdown formatting', async ({ page }) => {