From 617ceb791f5f0da075e2e99fdc3094947115eb69 Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 18 Sep 2026 16:57:00 -0700 Subject: [PATCH 1/2] test(editor): distinguish saved fallback from unsaved draft --- .../EditorContent.markdown-classification.test.tsx | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/renderer/src/components/editor/EditorContent.markdown-classification.test.tsx b/src/renderer/src/components/editor/EditorContent.markdown-classification.test.tsx index 7a9bff8cbc9..4e46d0a1582 100644 --- a/src/renderer/src/components/editor/EditorContent.markdown-classification.test.tsx +++ b/src/renderer/src/components/editor/EditorContent.markdown-classification.test.tsx @@ -95,12 +95,14 @@ function openFile( function renderEditPath({ content, + savedContent = '# Saved', language = 'markdown', viewMode = 'rich', mode = 'edit', onOpenMarkdownPreview }: { content: string + savedContent?: string language?: 'markdown' | 'typescript' viewMode?: 'source' | 'rich' | 'preview' mode?: 'edit' | 'markdown-preview' @@ -108,7 +110,7 @@ function renderEditPath({ }) { const activeFile = openFile(language, mode) const fileContents = { - [activeFile.id]: { content: '# Saved', isBinary: false } + [activeFile.id]: { content: savedContent, isBinary: false } } const editorDrafts = { [activeFile.id]: content } const model = getEditorPanelRenderModel({ @@ -309,7 +311,10 @@ describe('inline Markdown render classification', () => { }) it('offers the Preview toggle once rich mode falls back to source for this content', () => { - const fallback = renderEditPath({ content: '[reference]: https://example.com' }) + const fallback = renderEditPath({ + content: '[reference]: https://example.com', + savedContent: '[reference]: https://example.com' + }) expect(fallback.model.availableEditorToggleModes).toEqual([ 'source', 'rich', From 47344a41c6b98e085a50da903c3f85adb431e5de Mon Sep 17 00:00:00 2001 From: Neil Date: Fri, 18 Sep 2026 16:57:23 -0700 Subject: [PATCH 2/2] test(editor): keep stored preview fault aligned with saved content --- .../editor/EditorContent.markdown-classification.test.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/src/renderer/src/components/editor/EditorContent.markdown-classification.test.tsx b/src/renderer/src/components/editor/EditorContent.markdown-classification.test.tsx index 6e22b842a10..2a75f4a0a78 100644 --- a/src/renderer/src/components/editor/EditorContent.markdown-classification.test.tsx +++ b/src/renderer/src/components/editor/EditorContent.markdown-classification.test.tsx @@ -331,6 +331,7 @@ describe('inline Markdown render classification', () => { const content = '[reference]: https://example.com' const result = renderEditPath({ content, + savedContent: content, viewMode: 'source', markdownRichModeFaultedContent: { [openFile().id]: content } })