diff --git a/tests/smoke/emoji-icon-everywhere.spec.ts b/tests/smoke/emoji-icon-everywhere.spec.ts index 746247e6..ca554aaf 100644 --- a/tests/smoke/emoji-icon-everywhere.spec.ts +++ b/tests/smoke/emoji-icon-everywhere.spec.ts @@ -7,7 +7,7 @@ test.describe('Emoji icon shown everywhere title appears', () => { await page.waitForTimeout(2500) }) - test('emoji icon appears in tab bar, breadcrumb, and note list after setting it', async ({ page }) => { + test('emoji icon appears in editor and note list after setting it', async ({ page }) => { // Open a note const noteItem = page.locator('[data-testid="note-list-container"] .cursor-pointer').first() await noteItem.waitFor({ timeout: 5000 }) @@ -36,10 +36,11 @@ test.describe('Emoji icon shown everywhere title appears', () => { const noteListText = await noteItem.textContent() expect(noteListText).toContain(emojiText!) - // Verify emoji in the tab (active tab has the truncate span with title) - const tabArea = page.locator('.group .truncate').first() - const tabText = await tabArea.textContent() - expect(tabText).toContain(emojiText!) + // Verify emoji appears in the editor NoteIcon area + // Wait for frontmatter update to propagate through the single-note reload cycle + const iconAfterSet = page.locator('[data-testid="note-icon-display"]') + await expect(iconAfterSet).toBeVisible({ timeout: 8000 }) + await expect(iconAfterSet).toHaveText(emojiText!, { timeout: 3000 }) }) test('note without emoji shows no emoji span in tab or note list', async ({ page }) => { diff --git a/tests/smoke/improve-note-open-latency.spec.ts b/tests/smoke/improve-note-open-latency.spec.ts index b959bb57..f52a99ed 100644 --- a/tests/smoke/improve-note-open-latency.spec.ts +++ b/tests/smoke/improve-note-open-latency.spec.ts @@ -23,10 +23,6 @@ test.describe('Improve note open latency', () => { const editorContainer = page.locator('.editor__blocknote-container') await expect(editorContainer).toBeVisible({ timeout: 5000 }) - // A tab should be open - const tabBar = page.locator('[draggable]') - await expect(tabBar.first()).toBeVisible({ timeout: 3000 }) - // The editor should have BlockNote content const editorContent = page.locator('.bn-editor') await expect(editorContent).toBeVisible({ timeout: 3000 }) @@ -68,9 +64,8 @@ test.describe('Improve note open latency', () => { const editorContainer = page.locator('.editor__blocknote-container') await expect(editorContainer).toBeVisible({ timeout: 5000 }) - // At least one tab should be open - const tabs = page.locator('[draggable]') - const tabCount = await tabs.count() - expect(tabCount).toBeGreaterThan(0) + // The editor should have content loaded + const editorContent = page.locator('.bn-editor') + await expect(editorContent).toBeVisible({ timeout: 3000 }) }) }) diff --git a/tests/smoke/rename-wikilink-update.spec.ts b/tests/smoke/rename-wikilink-update.spec.ts index 5179aff4..f65cded3 100644 --- a/tests/smoke/rename-wikilink-update.spec.ts +++ b/tests/smoke/rename-wikilink-update.spec.ts @@ -7,7 +7,7 @@ test.describe('Renaming a note updates wikilinks across the vault', () => { await page.waitForLoadState('networkidle') }) - test('tab rename triggers rename flow and shows toast', async ({ page }) => { + test('title field rename triggers rename flow and shows toast', async ({ page }) => { // 1. Click the first note in the list to open it const noteListContainer = page.locator('[data-testid="note-list-container"]') await noteListContainer.waitFor({ timeout: 5000 }) @@ -15,29 +15,22 @@ test.describe('Renaming a note updates wikilinks across the vault', () => { await firstNote.click() await page.waitForTimeout(500) - // 2. Capture the original tab title - const tabTitle = page.locator('.group span.truncate').first() - await expect(tabTitle).toBeVisible({ timeout: 5000 }) - const originalTitle = await tabTitle.textContent() + // 2. Find the title field in the editor + const titleField = page.locator('[data-testid="title-field"] input, [data-testid="title-field"]') + await expect(titleField.first()).toBeVisible({ timeout: 5000 }) + const originalTitle = await titleField.first().inputValue().catch(() => titleField.first().textContent()) expect(originalTitle).toBeTruthy() - // 3. Double-click the tab to enter rename mode - await tabTitle.dblclick() - await page.waitForTimeout(300) - - // 4. Type a new name and press Enter - const editInput = page.locator('.group input') - await expect(editInput).toBeVisible({ timeout: 3000 }) + // 3. Click the title field and change the title + await titleField.first().click() + await page.keyboard.press('Meta+a') const newTitle = `${originalTitle} Renamed` - await editInput.fill(newTitle) - await editInput.press('Enter') - await page.waitForTimeout(1000) + await page.keyboard.type(newTitle) + await page.keyboard.press('Tab') // blur to trigger rename - // 5. Verify the tab title updated (rename mock handler returns a new path) - const newTabTitle = page.locator('.group span.truncate').first() - await expect(newTabTitle).toHaveText(newTitle, { timeout: 5000 }) + await page.waitForTimeout(1500) - // 6. Verify the toast message appeared (confirms rename flow ran, not just in-memory update) + // 4. Verify the toast message appeared (confirms rename flow ran) const toast = page.getByText('Renamed', { exact: true }) await expect(toast).toBeVisible({ timeout: 5000 }) })