test: assert note focus before opening creation form
Cross-platform packages / Validate source (push) Canceled after 0s
Cross-platform packages / Authorize desktop packaging (push) Canceled after 0s
Cross-platform packages / linux arm64 (push) Canceled after 0s
Cross-platform packages / macos arm64 (push) Canceled after 0s
Cross-platform packages / windows arm64 (push) Canceled after 0s
Cross-platform packages / linux x64 (push) Canceled after 0s
Cross-platform packages / macos x64 (push) Canceled after 0s
Cross-platform packages / windows x64 (push) Canceled after 0s
Cross-platform packages / Publish GitHub and OSS release (push) Canceled after 0s

Check detail navigation focus before the auto-focused creation input takes over. Preserve return-to-list and reading-position assertions, and include the reviewed sharing first-read test and independent validation record. Validation runs in CI per user request.
This commit is contained in:
mesalogo
2026-10-01 09:16:15 +08:00
parent 2c5300d031
commit 016f987026
4 changed files with 76 additions and 4 deletions
@@ -560,8 +560,10 @@ describe('MagicNotesWorkspace overview navigation', () => {
// Back to overview lives in the page header's top-right actions while a note is open.
expect(screen.getByRole('button', { name: '返回总览' }).closest('.page-header__actions')).not.toBeNull()
expect(screen.getByRole('button', { name: '返回总览' }).nextElementSibling).toBe(screen.getByRole('button', { name: '新建笔记' }))
await waitFor(() => expect(screen.getByRole('button', { name: '返回总览' })).toHaveFocus())
fireEvent.click(screen.getByRole('button', { name: '新建笔记' }))
expect(within(overview).getByLabelText('笔记标题')).toBeVisible()
expect(within(overview).getByLabelText('笔记标题')).toHaveFocus()
fireEvent.click(within(overview).getByRole('button', { name: '取消' }))
expect(screen.queryByRole('button', { name: '切换到待办' })).not.toBeInTheDocument()
expect(screen.getByRole('searchbox')).toBeVisible()
@@ -571,7 +573,6 @@ describe('MagicNotesWorkspace overview navigation', () => {
const css = readFileSync('src/renderer/src/styles.css', 'utf8')
expect(css).toMatch(/\.magic-notes-layout--detail\s*\{\s*border: 0;\s*border-radius: 0;/)
expect(css).toMatch(/\.magic-notes-stream-pane\s*\{[^}]*padding: 0 var\(--magic-note-stream-gutter\)/)
await waitFor(() => expect(screen.getByRole('button', { name: '返回总览' })).toHaveFocus())
back()
expect(overview).toBeVisible()
expect(screen.getByRole('heading', { level: 1, name: '魔法笔记' })).toBeVisible()