任务备注')
})
it('adds a compact, reusable Markdown editor and preview to memo details', () => {
expect(editor).toContain("import { applyMarkdownFormat, renderMarkdown")
expect(editor).toContain('aria-label="备忘录 Markdown 格式"')
expect(editor).toContain('aria-label="备忘录 Markdown 预览"')
expect(editor).toContain('@keydown="handleMemoBodyShortcut"')
expect(editor).toContain('v-if="!memoPreview && !memo.deleted_at"')
expect(css).toContain('.memo-markdown-field{display:grid;gap:7px')
expect(css).toContain('.memo-markdown-editor .markdown-toolbar{')
expect(css).toContain('.memo-markdown-preview{min-height:250px')
})
it('uses AppSheet for mobile memo detail while keeping desktop detail non-modal', () => {
expect(panel).toContain("import AppSheet from './components/AppSheet.vue'")
expect(panel).toContain('
{
expect(app).toContain('const memoDetailOpen = ref(false)')
expect(app).toContain("'memo-detail-open': activeView==='memos' && memoDetailOpen")
expect(app).toContain('@detail="memoDetailOpen=$event"')
expect(app).toContain(':inert="memoBackgroundInert ? true : undefined"')
expect(app).toContain(':show="showFloatingAdd"')
expect(css).toContain('.shell.memo-detail-open main{padding-right:372px}')
expect(css).toContain('.memo-editor__fields{flex:1;min-height:0;overflow-y:auto;overflow-x:hidden')
expect(css).toContain('@media(max-width:930px){.shell.memo-detail-open main{padding:20px 17px 112px}')
expect(css).toContain('.memo-editor{position:fixed;z-index:42;left:0;right:0;top:auto;bottom:0;width:100%;max-width:100%')
})
it('uses a 350px desktop detail, near-full mobile sheet, continuous rows and reduced motion', () => {
expect(css).toContain('.memo-editor{width:350px')
expect(css).toContain('.memo-list{display:grid;gap:0')
expect(css).toContain('.memo-row+.memo-row{border-top:1px solid var(--border-cream)}')
const mobileMedia = css.slice(css.indexOf('@media(max-width:930px){'), css.indexOf('@media(prefers-reduced-motion:reduce)'))
expect(mobileMedia).toContain('.memo-panel{')
expect(css).toContain('.memo-editor{position:fixed;z-index:42;left:0;right:0;top:auto')
expect(css).toContain('height:min(92dvh,820px)')
expect(css).toContain('@media(prefers-reduced-motion:reduce){.memo-editor')
expect(editor).toContain("window.addEventListener('beforeunload'")
})
})