feat: improve task note markdown editor
This commit is contained in:
@@ -273,7 +273,23 @@ describe('completion feedback motion', () => {
|
||||
expect(authBlock.indexOf("await syncBrowserTimezone(data.user?.timezone)")).toBeLessThan(authBlock.indexOf('await loadRestoredView()'))
|
||||
})
|
||||
|
||||
it('relies on the task PATCH for atomic due and recurrence synchronization', () => {
|
||||
it('provides a practical task-note Markdown toolbar with editing and preview modes', () => {
|
||||
expect(app).toContain('ref="taskNoteEditor"')
|
||||
expect(app).toContain('class="markdown-toolbar" role="toolbar" aria-label="Markdown 格式"')
|
||||
for (const label of ['标题', '粗体', '斜体', '无序列表', '有序列表', '待办', '链接', '行内代码', '代码块', '引用']) {
|
||||
expect(app).toContain(`aria-label="${label}"`)
|
||||
}
|
||||
expect(app).toContain('@click="formatTaskNote(')
|
||||
expect(app).toContain('@keydown="handleTaskNoteShortcut"')
|
||||
expect(app).toContain('class="markdown-mode-switch"')
|
||||
expect(app).toContain(':aria-pressed="!markdownPreview"')
|
||||
expect(app).toContain(':aria-pressed="markdownPreview"')
|
||||
expect(css).toContain('.markdown-toolbar{display:flex;')
|
||||
expect(css).toContain('overflow-x:auto')
|
||||
expect(css).toContain('.markdown-toolbar button{min-width:44px;min-height:44px;')
|
||||
})
|
||||
|
||||
it('keeps all task detail changes on the unified save button', () => {
|
||||
const saveTaskBlock = app.slice(app.indexOf('async function saveTask('), app.indexOf('async function saveSelectedTaskChanges('))
|
||||
expect(saveTaskBlock).not.toContain('/recurrences/')
|
||||
expect(saveTaskBlock).toContain('as Partial<Task>, false')
|
||||
|
||||
Reference in New Issue
Block a user