test: update smoke tests for single-note model (no tab bar)
Remove tab bar assertions from E2E tests. Update emoji icon test to check NoteIcon display instead of tab. Replace tab rename test with title field rename. Remove draggable tab assertions from latency test. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -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 }) => {
|
||||
|
||||
@@ -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 })
|
||||
})
|
||||
})
|
||||
|
||||
@@ -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 })
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user