From 622310a020f60751c0fdeafc1c160803997521e5 Mon Sep 17 00:00:00 2001 From: "Julia Roldi (from Dev Box)" Date: Wed, 19 Feb 2025 17:46:48 -0300 Subject: [PATCH] fix test --- .../convertMarkdownToContentModelTest.ts | 38 ++++++++++++++----- .../processor/markdownProcessorTest.ts | 5 +++ 2 files changed, 33 insertions(+), 10 deletions(-) diff --git a/packages/roosterjs-content-model-markdown/test/markdownToModel/convertMarkdownToContentModelTest.ts b/packages/roosterjs-content-model-markdown/test/markdownToModel/convertMarkdownToContentModelTest.ts index ba3ee1088ad..4cc1399444e 100644 --- a/packages/roosterjs-content-model-markdown/test/markdownToModel/convertMarkdownToContentModelTest.ts +++ b/packages/roosterjs-content-model-markdown/test/markdownToModel/convertMarkdownToContentModelTest.ts @@ -268,7 +268,9 @@ describe('convertMarkdownToContentModel', () => { segmentType: 'Text', isSelected: undefined, text: 'Header 1', - format: {}, + format: { + fontWeight: 'bold', + }, }, ], format: { @@ -304,7 +306,9 @@ describe('convertMarkdownToContentModel', () => { segmentType: 'Text', isSelected: undefined, text: 'Header 2', - format: {}, + format: { + fontWeight: 'bold', + }, }, ], format: { @@ -340,7 +344,9 @@ describe('convertMarkdownToContentModel', () => { segmentType: 'Text', isSelected: undefined, text: 'Header 3', - format: {}, + format: { + fontWeight: 'bold', + }, }, ], format: { @@ -658,7 +664,9 @@ describe('convertMarkdownToContentModel', () => { segmentType: 'Text', isSelected: undefined, text: 'Header 1', - format: {}, + format: { + fontWeight: 'bold', + }, }, ], format: { @@ -694,7 +702,9 @@ describe('convertMarkdownToContentModel', () => { segmentType: 'Text', isSelected: undefined, text: 'Header 2', - format: {}, + format: { + fontWeight: 'bold', + }, }, ], format: { @@ -730,7 +740,9 @@ describe('convertMarkdownToContentModel', () => { segmentType: 'Text', isSelected: undefined, text: 'Header 3', - format: {}, + format: { + fontWeight: 'bold', + }, }, ], format: { @@ -1044,7 +1056,7 @@ describe('convertMarkdownToContentModel', () => { runTest(list, expectedContentModel); }); - it('should convert simple doc', () => { + it('should convert sample doc', () => { const markdown = `# Sample Markdown Document\rThis document showcases basic Markdown syntax.\n## Paragraphs\nThis is a paragraph. It can span multiple lines and is rendered as a single block of text.\nHere's another paragraph, separated by a blank line.\n## Emphasis\n*Italic text* (using asterisks)\n**Bold text** (using double asterisks)\n***Bold and italic*** (using triple asterisks)\n## Lists\n### Unordered List\n- First item\n- Second item\n- Third item\n - Second level list item\n### Ordered List\n1. First item\n2. Second item\n3. Third item\n 1. Second level list item\n## Tables\n| Header 1 | Header 2 | Header 3 |\n|----------|----------|----------|\n| Row 1 | Data 1 | Data 1 |\n| Row 2 | Data 2 | Data 2 |\n| Row 3 | Data 3 | Data 3 |\n## Links and Images\nHere is a [link to Markdown documentation](https://commonmark.org).\n![Markdown Logo](https://markdown-here.com/img/icon256.png)\n## Blockquotes\n> This is a quote.\n> It can span multiple lines.\n`; const sample: ContentModelDocument = { blockGroupType: 'Document', @@ -1653,7 +1665,9 @@ describe('convertMarkdownToContentModel', () => { text: 'Header 1', segmentType: 'Text', isSelected: undefined, - format: {}, + format: { + fontWeight: 'bold', + }, }, ], segmentFormat: undefined, @@ -1689,7 +1703,9 @@ describe('convertMarkdownToContentModel', () => { text: 'Header 2', segmentType: 'Text', isSelected: undefined, - format: {}, + format: { + fontWeight: 'bold', + }, }, ], segmentFormat: undefined, @@ -1725,7 +1741,9 @@ describe('convertMarkdownToContentModel', () => { text: 'Header 3', segmentType: 'Text', isSelected: undefined, - format: {}, + format: { + fontWeight: 'bold', + }, }, ], segmentFormat: undefined, diff --git a/packages/roosterjs-content-model-markdown/test/markdownToModel/processor/markdownProcessorTest.ts b/packages/roosterjs-content-model-markdown/test/markdownToModel/processor/markdownProcessorTest.ts index 1d2363555fb..0a2e0d98024 100644 --- a/packages/roosterjs-content-model-markdown/test/markdownToModel/processor/markdownProcessorTest.ts +++ b/packages/roosterjs-content-model-markdown/test/markdownToModel/processor/markdownProcessorTest.ts @@ -554,6 +554,7 @@ describe('markdownProcessor', () => { borderBottom: '1px solid #ABABAB', borderLeft: '1px solid #ABABAB', backgroundColor: '#ABABAB', + fontWeight: 'bold', }, isHeader: true, }, @@ -653,6 +654,7 @@ describe('markdownProcessor', () => { borderBottom: '1px solid #ABABAB', borderLeft: '1px solid #ABABAB', backgroundColor: '#ABABAB', + fontWeight: 'bold', }, isHeader: true, }, @@ -681,6 +683,7 @@ describe('markdownProcessor', () => { borderBottom: '1px solid #ABABAB', borderLeft: '1px solid #ABABAB', backgroundColor: '#ABABAB', + fontWeight: 'bold', }, isHeader: true, }, @@ -807,6 +810,7 @@ describe('markdownProcessor', () => { borderBottom: '1px solid #ABABAB', borderLeft: '1px solid #ABABAB', backgroundColor: '#ABABAB', + fontWeight: 'bold', }, isHeader: true, }, @@ -835,6 +839,7 @@ describe('markdownProcessor', () => { borderBottom: '1px solid #ABABAB', borderLeft: '1px solid #ABABAB', backgroundColor: '#ABABAB', + fontWeight: 'bold', }, isHeader: true, },