diff --git a/tests/package.json b/tests/package.json index 72d75315d0..68357b2a56 100644 --- a/tests/package.json +++ b/tests/package.json @@ -18,12 +18,15 @@ "@blocknote/mantine": "workspace:^", "@blocknote/react": "workspace:^", "@blocknote/shadcn": "workspace:^", + "@blocknote/xl-docx-exporter": "workspace:^", "@playwright/experimental-ct-react": "1.51.1", "@playwright/test": "1.51.1", "@tiptap/pm": "^2.12.0", "@types/node": "^20.11.18", "@types/react": "^18.0.25", "@types/react-dom": "^18.0.9", + "@zip.js/zip.js": "^2.7.57", + "docx": "^9.0.2", "eslint": "^8.10.0", "htmlfy": "^0.6.7", "react": "^18.3.1", @@ -32,7 +35,8 @@ "rimraf": "^5.0.5", "vite": "^5.3.4", "vite-plugin-eslint": "^1.8.1", - "vitest": "^2.0.3" + "vitest": "^2.0.3", + "xml-formatter": "^3.6.3" }, "eslintConfig": { "extends": [ diff --git a/tests/src/unit/core/clipboard/copy/copyTestInstances.ts b/tests/src/unit/core/clipboard/copy/copyTestInstances.ts index 9e709ab630..c9969d1c72 100644 --- a/tests/src/unit/core/clipboard/copy/copyTestInstances.ts +++ b/tests/src/unit/core/clipboard/copy/copyTestInstances.ts @@ -6,12 +6,12 @@ import { TestInlineContentSchema, TestStyleSchema, } from "../../testSchema.js"; -import { CopyTestCase } from "../../../shared/clipboard/copy/copyTestCase.js"; -import { testCopyHTML } from "../../../shared/clipboard/copy/copyTestExecutors.js"; +import { CopyTestCase } from "../../../testTypes/clipboard/copy/copyTestCase.js"; +import { testCopyHTML } from "../../../testTypes/clipboard/copy/copyTestExecutors.js"; import { getPosOfTableCellNode, getPosOfTextNode, -} from "../../../shared/testUtil.js"; +} from "../../../testTypes/testUtil.js"; import { TestInstance } from "../../../types.js"; export const copyTestInstancesHTML: TestInstance< diff --git a/tests/src/unit/core/clipboard/copyPaste/copyPasteTestInstances.ts b/tests/src/unit/core/clipboard/copyPaste/copyPasteTestInstances.ts index 8752bcb101..373f831dbd 100644 --- a/tests/src/unit/core/clipboard/copyPaste/copyPasteTestInstances.ts +++ b/tests/src/unit/core/clipboard/copyPaste/copyPasteTestInstances.ts @@ -5,9 +5,9 @@ import { TestInlineContentSchema, TestStyleSchema, } from "../../testSchema.js"; -import { CopyPasteTestCase } from "../../../shared/clipboard/copyPaste/copyPasteTestCase.js"; -import { testCopyPaste } from "../../../shared/clipboard/copyPaste/copyPasteTestExecutors.js"; -import { getPosOfTextNode } from "../../../shared/testUtil.js"; +import { CopyPasteTestCase } from "../../../testTypes/clipboard/copyPaste/copyPasteTestCase.js"; +import { testCopyPaste } from "../../../testTypes/clipboard/copyPaste/copyPasteTestExecutors.js"; +import { getPosOfTextNode } from "../../../testTypes/testUtil.js"; import { TestInstance } from "../../../types.js"; export const copyPasteTestInstances: TestInstance< diff --git a/tests/src/unit/core/clipboard/copyPasteEquality/copyPasteEqualityTestInstances.ts b/tests/src/unit/core/clipboard/copyPasteEquality/copyPasteEqualityTestInstances.ts index e3bc47da79..7a8aaf1a0c 100644 --- a/tests/src/unit/core/clipboard/copyPasteEquality/copyPasteEqualityTestInstances.ts +++ b/tests/src/unit/core/clipboard/copyPasteEquality/copyPasteEqualityTestInstances.ts @@ -3,8 +3,8 @@ import { TestInlineContentSchema, TestStyleSchema, } from "../../testSchema.js"; -import { CopyPasteEqualityTestCase } from "../../../shared/clipboard/copyPasteEquality/copyPasteEqualityTestCase.js"; -import { testCopyPasteEquality } from "../../../shared/clipboard/copyPasteEquality/copyPasteEqualityTestExecutors.js"; +import { CopyPasteEqualityTestCase } from "../../../testTypes/clipboard/copyPasteEquality/copyPasteEqualityTestCase.js"; +import { testCopyPasteEquality } from "../../../testTypes/clipboard/copyPasteEquality/copyPasteEqualityTestExecutors.js"; import { TestInstance } from "../../../types.js"; import { copyTestInstancesHTML } from "../copy/copyTestInstances.js"; diff --git a/tests/src/unit/core/clipboard/paste/pasteTestInstances.ts b/tests/src/unit/core/clipboard/paste/pasteTestInstances.ts index 404cd8cb83..97274764b8 100644 --- a/tests/src/unit/core/clipboard/paste/pasteTestInstances.ts +++ b/tests/src/unit/core/clipboard/paste/pasteTestInstances.ts @@ -5,12 +5,12 @@ import { TestInlineContentSchema, TestStyleSchema, } from "../../testSchema.js"; -import { PasteTestCase } from "../../../shared/clipboard/paste/pasteTestCase.js"; +import { PasteTestCase } from "../../../testTypes/clipboard/paste/pasteTestCase.js"; import { testPasteHTML, testPasteMarkdown, -} from "../../../shared/clipboard/paste/pasteTestExecutors.js"; -import { getPosOfTextNode } from "../../../shared/testUtil.js"; +} from "../../../testTypes/clipboard/paste/pasteTestExecutors.js"; +import { getPosOfTextNode } from "../../../testTypes/testUtil.js"; import { TestInstance } from "../../../types.js"; export const pasteTestInstancesHTML: TestInstance< diff --git a/tests/src/unit/core/formatConversion/export/exportTestInstances.ts b/tests/src/unit/core/formatConversion/export/exportTestInstances.ts index f6f38ba522..be7fa47450 100644 --- a/tests/src/unit/core/formatConversion/export/exportTestInstances.ts +++ b/tests/src/unit/core/formatConversion/export/exportTestInstances.ts @@ -1,10 +1,10 @@ -import { ExportTestCase } from "../../../shared/formatConversion/export/exportTestCase.js"; +import { ExportTestCase } from "../../../testTypes/formatConversion/export/exportTestCase.js"; import { testExportBlockNoteHTML, testExportHTML, testExportMarkdown, testExportNodes, -} from "../../../shared/formatConversion/export/exportTestExecutors.js"; +} from "../../../testTypes/formatConversion/export/exportTestExecutors.js"; import { TestInstance } from "../../../types.js"; import { TestBlockSchema, diff --git a/tests/src/unit/core/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts b/tests/src/unit/core/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts index 63d3552df0..c4b808d8ba 100644 --- a/tests/src/unit/core/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts +++ b/tests/src/unit/core/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts @@ -1,5 +1,5 @@ -import { ExportParseEqualityTestCase } from "../../../shared/formatConversion/exportParseEquality/exportParseEqualityTestCase.js"; -import { testExportParseEqualityBlockNoteHTML } from "../../../shared/formatConversion/exportParseEquality/exportParseEqualityTestExecutors.js"; +import { ExportParseEqualityTestCase } from "../../../testTypes/formatConversion/exportParseEquality/exportParseEqualityTestCase.js"; +import { testExportParseEqualityBlockNoteHTML } from "../../../testTypes/formatConversion/exportParseEquality/exportParseEqualityTestExecutors.js"; import { TestInstance } from "../../../types.js"; import { TestBlockSchema, diff --git a/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts b/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts index 24691a3946..07a4111c70 100644 --- a/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts +++ b/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts @@ -1,8 +1,8 @@ -import { ParseTestCase } from "../../../shared/formatConversion/parse/parseTestCase.js"; +import { ParseTestCase } from "../../../testTypes/formatConversion/parse/parseTestCase.js"; import { testParseHTML, testParseMarkdown, -} from "../../../shared/formatConversion/parse/parseTestExecutors.js"; +} from "../../../testTypes/formatConversion/parse/parseTestExecutors.js"; import { TestInstance } from "../../../types.js"; import { TestBlockSchema, diff --git a/tests/src/unit/core/selection/getSelection/getSelectionTestInstances.ts b/tests/src/unit/core/selection/getSelection/getSelectionTestInstances.ts index 674c8976d4..41aa26915a 100644 --- a/tests/src/unit/core/selection/getSelection/getSelectionTestInstances.ts +++ b/tests/src/unit/core/selection/getSelection/getSelectionTestInstances.ts @@ -6,15 +6,15 @@ import { TestInlineContentSchema, TestStyleSchema, } from "../../testSchema.js"; -import { GetSelectionTestCase } from "../../../shared/selection/getSelection/getSelectionTestCase.js"; +import { GetSelectionTestCase } from "../../../testTypes/selection/getSelection/getSelectionTestCase.js"; import { testGetSelectionRegular, testGetSelectionCutBlocks, -} from "../../../shared/selection/getSelection/getSelectionTestExecutors.js"; +} from "../../../testTypes/selection/getSelection/getSelectionTestExecutors.js"; import { getPosOfTableCellNode, getPosOfTextNode, -} from "../../../shared/testUtil.js"; +} from "../../../testTypes/testUtil.js"; import { TestInstance } from "../../../types.js"; export const getSelectionTestInstancesRegular: TestInstance< diff --git a/tests/src/unit/core/selection/incrementSelection/incrementSelectionTestInstances.ts b/tests/src/unit/core/selection/incrementSelection/incrementSelectionTestInstances.ts index bf05d22692..2e7e5110d7 100644 --- a/tests/src/unit/core/selection/incrementSelection/incrementSelectionTestInstances.ts +++ b/tests/src/unit/core/selection/incrementSelection/incrementSelectionTestInstances.ts @@ -3,11 +3,11 @@ import { TestInlineContentSchema, TestStyleSchema, } from "../../testSchema.js"; -import { IncrementSelectionTestCase } from "../../../shared/selection/incrementSelection/incrementSelectionTestCase.js"; +import { IncrementSelectionTestCase } from "../../../testTypes/selection/incrementSelection/incrementSelectionTestCase.js"; import { testIncrementSelectionEnd, testIncrementSelectionStart, -} from "../../../shared/selection/incrementSelection/incrementSelectionTestExecutors.js"; +} from "../../../testTypes/selection/incrementSelection/incrementSelectionTestExecutors.js"; import { TestInstance } from "../../../types.js"; export const incrementSelectionTestInstancesStart: TestInstance< diff --git a/tests/src/unit/core/selection/textCursorPosition/textCursorPositionTestInstances.ts b/tests/src/unit/core/selection/textCursorPosition/textCursorPositionTestInstances.ts index 947e801f1b..dc61b7773c 100644 --- a/tests/src/unit/core/selection/textCursorPosition/textCursorPositionTestInstances.ts +++ b/tests/src/unit/core/selection/textCursorPosition/textCursorPositionTestInstances.ts @@ -3,12 +3,12 @@ import { TestInlineContentSchema, TestStyleSchema, } from "../../testSchema.js"; -import { TextCursorPositionTestCase } from "../../../shared/selection/textCursorPosition/textCursorPositionTestCase.js"; +import { TextCursorPositionTestCase } from "../../../testTypes/selection/textCursorPosition/textCursorPositionTestCase.js"; import { testTextCursorPositionEnd, testTextCursorPositionSetAndGet, testTextCursorPositionStart, -} from "../../../shared/selection/textCursorPosition/textCursorPositionTestExecutors.js"; +} from "../../../testTypes/selection/textCursorPosition/textCursorPositionTestExecutors.js"; import { TestInstance } from "../../../types.js"; export const getTextCursorPositionTestInstancesGetAndSet: TestInstance< diff --git a/tests/src/unit/react/setupTestEditor.tsx b/tests/src/unit/react/createTestEditor.tsx similarity index 98% rename from tests/src/unit/react/setupTestEditor.tsx rename to tests/src/unit/react/createTestEditor.tsx index 54d01a9b67..cf30144ee5 100644 --- a/tests/src/unit/react/setupTestEditor.tsx +++ b/tests/src/unit/react/createTestEditor.tsx @@ -13,7 +13,7 @@ import { afterAll, beforeAll } from "vitest"; import { TestContext } from "./testSchema.js"; -export const setupTestEditor = < +export const createTestEditor = < B extends BlockSchema, I extends InlineContentSchema, S extends StyleSchema, diff --git a/tests/src/unit/react/formatConversion/export/exportTestInstances.ts b/tests/src/unit/react/formatConversion/export/exportTestInstances.ts index d822928fb6..b8410aca40 100644 --- a/tests/src/unit/react/formatConversion/export/exportTestInstances.ts +++ b/tests/src/unit/react/formatConversion/export/exportTestInstances.ts @@ -1,8 +1,8 @@ -import { ExportTestCase } from "../../../shared/formatConversion/export/exportTestCase.js"; +import { ExportTestCase } from "../../../testTypes/formatConversion/export/exportTestCase.js"; import { testExportBlockNoteHTML, testExportHTML, -} from "../../../shared/formatConversion/export/exportTestExecutors.js"; +} from "../../../testTypes/formatConversion/export/exportTestExecutors.js"; import { TestInstance } from "../../../types.js"; import { TestBlockSchema, diff --git a/tests/src/unit/react/formatConversion/export/runTests.test.ts b/tests/src/unit/react/formatConversion/export/runTests.test.ts index 92395d74ff..1a4837e790 100644 --- a/tests/src/unit/react/formatConversion/export/runTests.test.ts +++ b/tests/src/unit/react/formatConversion/export/runTests.test.ts @@ -1,6 +1,6 @@ import { describe, it } from "vitest"; -import { setupTestEditor } from "../../setupTestEditor.js"; +import { createTestEditor } from "../../createTestEditor.js"; import { testSchema } from "../../testSchema.js"; import { exportTestInstancesBlockNoteHTML, @@ -8,7 +8,7 @@ import { } from "./exportTestInstances.js"; describe("React export tests (BlockNote HTML)", () => { - const getEditor = setupTestEditor(testSchema); + const getEditor = createTestEditor(testSchema); for (const { testCase, executeTest } of exportTestInstancesBlockNoteHTML) { it(`${testCase.name}`, async () => { @@ -18,7 +18,7 @@ describe("React export tests (BlockNote HTML)", () => { }); describe("React export tests (HTML)", () => { - const getEditor = setupTestEditor(testSchema); + const getEditor = createTestEditor(testSchema); for (const { testCase, executeTest } of exportTestInstancesHTML) { it(`${testCase.name}`, async () => { diff --git a/tests/src/unit/react/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts b/tests/src/unit/react/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts index 2deca013d9..03e3e5566f 100644 --- a/tests/src/unit/react/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts +++ b/tests/src/unit/react/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts @@ -1,8 +1,8 @@ -import { ExportParseEqualityTestCase } from "../../../shared/formatConversion/exportParseEquality/exportParseEqualityTestCase.js"; +import { ExportParseEqualityTestCase } from "../../../testTypes/formatConversion/exportParseEquality/exportParseEqualityTestCase.js"; import { testExportParseEqualityBlockNoteHTML, testExportParseEqualityNodes, -} from "../../../shared/formatConversion/exportParseEquality/exportParseEqualityTestExecutors.js"; +} from "../../../testTypes/formatConversion/exportParseEquality/exportParseEqualityTestExecutors.js"; import { TestInstance } from "../../../types.js"; import { TestBlockSchema, diff --git a/tests/src/unit/react/formatConversion/exportParseEquality/runTests.test.ts b/tests/src/unit/react/formatConversion/exportParseEquality/runTests.test.ts index 75bfe85897..7e40faf51b 100644 --- a/tests/src/unit/react/formatConversion/exportParseEquality/runTests.test.ts +++ b/tests/src/unit/react/formatConversion/exportParseEquality/runTests.test.ts @@ -1,6 +1,6 @@ import { describe, it } from "vitest"; -import { setupTestEditor } from "../../setupTestEditor.js"; +import { createTestEditor } from "../../createTestEditor.js"; import { testSchema } from "../../testSchema.js"; import { exportParseEqualityTestInstancesBlockNoteHTML, @@ -8,7 +8,7 @@ import { } from "./exportParseEqualityTestInstances.js"; describe("Export/parse equality tests (BlockNote HTML)", () => { - const getEditor = setupTestEditor(testSchema); + const getEditor = createTestEditor(testSchema); for (const { testCase, @@ -21,7 +21,7 @@ describe("Export/parse equality tests (BlockNote HTML)", () => { }); describe("Export/parse equality tests (TipTap nodes)", () => { - const getEditor = setupTestEditor(testSchema); + const getEditor = createTestEditor(testSchema); for (const { testCase, diff --git a/tests/src/unit/shared/formatConversion/export/exportTestExecutors.ts b/tests/src/unit/shared/formatConversion/export/exportTestExecutors.ts deleted file mode 100644 index 055218bb22..0000000000 --- a/tests/src/unit/shared/formatConversion/export/exportTestExecutors.ts +++ /dev/null @@ -1,86 +0,0 @@ -import { - BlockNoteEditor, - BlockSchema, - blockToNode, - InlineContentSchema, - StyleSchema, -} from "@blocknote/core"; -import { prettify } from "htmlfy"; -import { expect } from "vitest"; - -import { addIdsToBlocks } from "../formatConversionTestUtil.js"; -import { ExportTestCase } from "./exportTestCase.js"; - -export const testExportBlockNoteHTML = async < - B extends BlockSchema, - I extends InlineContentSchema, - S extends StyleSchema, ->( - editor: BlockNoteEditor, - testCase: ExportTestCase, -) => { - (window as any).__TEST_OPTIONS.mockID = 0; - - addIdsToBlocks(testCase.content); - - await expect( - prettify(await editor.blocksToFullHTML(testCase.content), { - tag_wrap: true, - }), - ).toMatchFileSnapshot(`./__snapshots__/blocknoteHTML/${testCase.name}.html`); -}; - -export const testExportHTML = async < - B extends BlockSchema, - I extends InlineContentSchema, - S extends StyleSchema, ->( - editor: BlockNoteEditor, - testCase: ExportTestCase, -) => { - (window as any).__TEST_OPTIONS.mockID = 0; - - addIdsToBlocks(testCase.content); - - await expect( - prettify(await editor.blocksToHTMLLossy(testCase.content), { - tag_wrap: true, - }), - ).toMatchFileSnapshot(`./__snapshots__/html/${testCase.name}.html`); -}; - -export const testExportMarkdown = async < - B extends BlockSchema, - I extends InlineContentSchema, - S extends StyleSchema, ->( - editor: BlockNoteEditor, - testCase: ExportTestCase, -) => { - (window as any).__TEST_OPTIONS.mockID = 0; - - addIdsToBlocks(testCase.content); - - await expect( - await editor.blocksToMarkdownLossy(testCase.content), - ).toMatchFileSnapshot(`./__snapshots__/markdown/${testCase.name}.md`); -}; - -export const testExportNodes = async < - B extends BlockSchema, - I extends InlineContentSchema, - S extends StyleSchema, ->( - editor: BlockNoteEditor, - testCase: ExportTestCase, -) => { - (window as any).__TEST_OPTIONS.mockID = 0; - - addIdsToBlocks(testCase.content); - - await expect( - testCase.content.map((block) => - blockToNode(block, editor.pmSchema, editor.schema.styleSchema), - ), - ).toMatchFileSnapshot(`./__snapshots__/nodes/${testCase.name}.json`); -}; diff --git a/tests/src/unit/shared/clipboard/clipboardTestUtil.ts b/tests/src/unit/testTypes/clipboard/clipboardTestUtil.ts similarity index 100% rename from tests/src/unit/shared/clipboard/clipboardTestUtil.ts rename to tests/src/unit/testTypes/clipboard/clipboardTestUtil.ts diff --git a/tests/src/unit/shared/clipboard/copy/copyTestCase.ts b/tests/src/unit/testTypes/clipboard/copy/copyTestCase.ts similarity index 100% rename from tests/src/unit/shared/clipboard/copy/copyTestCase.ts rename to tests/src/unit/testTypes/clipboard/copy/copyTestCase.ts diff --git a/tests/src/unit/shared/clipboard/copy/copyTestExecutors.ts b/tests/src/unit/testTypes/clipboard/copy/copyTestExecutors.ts similarity index 100% rename from tests/src/unit/shared/clipboard/copy/copyTestExecutors.ts rename to tests/src/unit/testTypes/clipboard/copy/copyTestExecutors.ts diff --git a/tests/src/unit/shared/clipboard/copyPaste/copyPasteTestCase.ts b/tests/src/unit/testTypes/clipboard/copyPaste/copyPasteTestCase.ts similarity index 100% rename from tests/src/unit/shared/clipboard/copyPaste/copyPasteTestCase.ts rename to tests/src/unit/testTypes/clipboard/copyPaste/copyPasteTestCase.ts diff --git a/tests/src/unit/shared/clipboard/copyPaste/copyPasteTestExecutors.ts b/tests/src/unit/testTypes/clipboard/copyPaste/copyPasteTestExecutors.ts similarity index 100% rename from tests/src/unit/shared/clipboard/copyPaste/copyPasteTestExecutors.ts rename to tests/src/unit/testTypes/clipboard/copyPaste/copyPasteTestExecutors.ts diff --git a/tests/src/unit/shared/clipboard/copyPasteEquality/copyPasteEqualityTestCase.ts b/tests/src/unit/testTypes/clipboard/copyPasteEquality/copyPasteEqualityTestCase.ts similarity index 100% rename from tests/src/unit/shared/clipboard/copyPasteEquality/copyPasteEqualityTestCase.ts rename to tests/src/unit/testTypes/clipboard/copyPasteEquality/copyPasteEqualityTestCase.ts diff --git a/tests/src/unit/shared/clipboard/copyPasteEquality/copyPasteEqualityTestExecutors.ts b/tests/src/unit/testTypes/clipboard/copyPasteEquality/copyPasteEqualityTestExecutors.ts similarity index 100% rename from tests/src/unit/shared/clipboard/copyPasteEquality/copyPasteEqualityTestExecutors.ts rename to tests/src/unit/testTypes/clipboard/copyPasteEquality/copyPasteEqualityTestExecutors.ts diff --git a/tests/src/unit/shared/clipboard/paste/pasteTestCase.ts b/tests/src/unit/testTypes/clipboard/paste/pasteTestCase.ts similarity index 100% rename from tests/src/unit/shared/clipboard/paste/pasteTestCase.ts rename to tests/src/unit/testTypes/clipboard/paste/pasteTestCase.ts diff --git a/tests/src/unit/shared/clipboard/paste/pasteTestExecutors.ts b/tests/src/unit/testTypes/clipboard/paste/pasteTestExecutors.ts similarity index 100% rename from tests/src/unit/shared/clipboard/paste/pasteTestExecutors.ts rename to tests/src/unit/testTypes/clipboard/paste/pasteTestExecutors.ts diff --git a/tests/src/unit/shared/formatConversion/export/exportTestCase.ts b/tests/src/unit/testTypes/formatConversion/export/exportTestCase.ts similarity index 100% rename from tests/src/unit/shared/formatConversion/export/exportTestCase.ts rename to tests/src/unit/testTypes/formatConversion/export/exportTestCase.ts diff --git a/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportBlockNoteHTML.ts b/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportBlockNoteHTML.ts new file mode 100644 index 0000000000..ac6681cc0d --- /dev/null +++ b/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportBlockNoteHTML.ts @@ -0,0 +1,30 @@ +import { + BlockNoteEditor, + BlockSchema, + InlineContentSchema, + StyleSchema, +} from "@blocknote/core"; +import { prettify } from "htmlfy"; +import { expect } from "vitest"; + +import { addIdsToBlocks } from "../../formatConversionTestUtil.js"; +import { ExportTestCase } from "../exportTestCase.js"; + +export const testExportBlockNoteHTML = async < + B extends BlockSchema, + I extends InlineContentSchema, + S extends StyleSchema, +>( + editor: BlockNoteEditor, + testCase: ExportTestCase, +) => { + (window as any).__TEST_OPTIONS.mockID = 0; + + addIdsToBlocks(testCase.content); + + await expect( + prettify(await editor.blocksToFullHTML(testCase.content), { + tag_wrap: true, + }), + ).toMatchFileSnapshot(`./__snapshots__/blocknoteHTML/${testCase.name}.html`); +}; diff --git a/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportDocX.ts b/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportDocX.ts new file mode 100644 index 0000000000..55412d5f54 --- /dev/null +++ b/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportDocX.ts @@ -0,0 +1,55 @@ +import { + BlockNoteEditor, + BlockNoteSchema, + BlockSchema, + defaultBlockSpecs, + InlineContentSchema, + PageBreak, + StyleSchema, +} from "@blocknote/core"; +import { + docxDefaultSchemaMappings, + DOCXExporter, +} from "@blocknote/xl-docx-exporter"; +import { BlobReader, ZipReader } from "@zip.js/zip.js"; +import { Packer } from "docx"; +import { expect } from "vitest"; + +import { + addIdsToBlocks, + getZIPEntryContent, + partialBlocksToBlocksForTesting, + prettify, +} from "../../formatConversionTestUtil.js"; +import { ExportTestCase } from "../exportTestCase.js"; + +export const testExportDocX = async < + B extends BlockSchema, + I extends InlineContentSchema, + S extends StyleSchema, +>( + editor: BlockNoteEditor, + testCase: ExportTestCase, +) => { + (window as any).__TEST_OPTIONS.mockID = 0; + + addIdsToBlocks(testCase.content); + + const exporter = new DOCXExporter(editor.schema, docxDefaultSchemaMappings); + const doc = await exporter.toDocxJsDocument( + partialBlocksToBlocksForTesting(editor.schema, testCase.content), + ); + + const blob = await Packer.toBlob(doc); + const zip = new ZipReader(new BlobReader(blob)); + const entries = await zip.getEntries(); + + await expect( + prettify(await getZIPEntryContent(entries, "word/document.xml")), + ).toMatchFileSnapshot(`__snapshots__/docx/${testCase.name}/document.xml`); + await expect( + prettify(await getZIPEntryContent(entries, "word/styles.xml")), + ).toMatchFileSnapshot(`__snapshots__/docx/${testCase.name}/styles.xml`); + + // fs.writeFileSync(__dirname + "/My Document.docx", buffer); +}; diff --git a/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportDocXOptions.ts b/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportDocXOptions.ts new file mode 100644 index 0000000000..2eefe56ff8 --- /dev/null +++ b/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportDocXOptions.ts @@ -0,0 +1,86 @@ +import { + BlockNoteEditor, + BlockSchema, + InlineContentSchema, + StyleSchema, +} from "@blocknote/core"; +import { + docxDefaultSchemaMappings, + DOCXExporter, +} from "@blocknote/xl-docx-exporter"; +import { BlobReader, ZipReader } from "@zip.js/zip.js"; +import { Packer, Paragraph, TextRun } from "docx"; +import { expect } from "vitest"; + +import { + addIdsToBlocks, + getZIPEntryContent, + partialBlocksToBlocksForTesting, + prettify, +} from "../../formatConversionTestUtil.js"; +import { ExportTestCase } from "../exportTestCase.js"; + +export const testExportDocXOptions = async < + B extends BlockSchema, + I extends InlineContentSchema, + S extends StyleSchema, +>( + editor: BlockNoteEditor, + testCase: ExportTestCase, +) => { + (window as any).__TEST_OPTIONS.mockID = 0; + + addIdsToBlocks(testCase.content); + + const exporter = new DOCXExporter(editor.schema, docxDefaultSchemaMappings); + + const doc = await exporter.toDocxJsDocument( + partialBlocksToBlocksForTesting(editor.schema, testCase.content), + { + documentOptions: { + creator: "John Doe", + }, + sectionOptions: { + headers: { + default: { + options: { + children: [new Paragraph({ children: [new TextRun("Header")] })], + }, + }, + }, + footers: { + default: { + options: { + children: [new Paragraph({ children: [new TextRun("Footer")] })], + }, + }, + }, + }, + }, + ); + + const blob = await Packer.toBlob(doc); + + // fs.writeFileSync(__dirname + "/My Document.docx", buffer); + + const zip = new ZipReader(new BlobReader(blob)); + const entries = await zip.getEntries(); + + // files related to header / footer + await expect( + prettify(await getZIPEntryContent(entries, "word/_rels/document.xml.rels")), + ).toMatchFileSnapshot("__snapshots__/withCustomOptions/document.xml.rels"); + + await expect( + prettify(await getZIPEntryContent(entries, "word/header1.xml")), + ).toMatchFileSnapshot("__snapshots__/withCustomOptions/header1.xml"); + + await expect( + prettify(await getZIPEntryContent(entries, "word/footer1.xml")), + ).toMatchFileSnapshot("__snapshots__/withCustomOptions/footer1.xml"); + + // has author data + await expect( + prettify(await getZIPEntryContent(entries, "docProps/core.xml")), + ).toMatchFileSnapshot("__snapshots__/withCustomOptions/core.xml"); +}; diff --git a/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportHTML.ts b/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportHTML.ts new file mode 100644 index 0000000000..548930ac2a --- /dev/null +++ b/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportHTML.ts @@ -0,0 +1,30 @@ +import { + BlockNoteEditor, + BlockSchema, + InlineContentSchema, + StyleSchema, +} from "@blocknote/core"; +import { prettify } from "htmlfy"; +import { expect } from "vitest"; + +import { addIdsToBlocks } from "../../formatConversionTestUtil.js"; +import { ExportTestCase } from "../exportTestCase.js"; + +export const testExportHTML = async < + B extends BlockSchema, + I extends InlineContentSchema, + S extends StyleSchema, +>( + editor: BlockNoteEditor, + testCase: ExportTestCase, +) => { + (window as any).__TEST_OPTIONS.mockID = 0; + + addIdsToBlocks(testCase.content); + + await expect( + prettify(await editor.blocksToHTMLLossy(testCase.content), { + tag_wrap: true, + }), + ).toMatchFileSnapshot(`./__snapshots__/html/${testCase.name}.html`); +}; diff --git a/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportMarkdown.ts b/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportMarkdown.ts new file mode 100644 index 0000000000..26dde08efb --- /dev/null +++ b/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportMarkdown.ts @@ -0,0 +1,27 @@ +import { + BlockNoteEditor, + BlockSchema, + InlineContentSchema, + StyleSchema, +} from "@blocknote/core"; +import { expect } from "vitest"; + +import { addIdsToBlocks } from "../../formatConversionTestUtil.js"; +import { ExportTestCase } from "../exportTestCase.js"; + +export const testExportMarkdown = async < + B extends BlockSchema, + I extends InlineContentSchema, + S extends StyleSchema, +>( + editor: BlockNoteEditor, + testCase: ExportTestCase, +) => { + (window as any).__TEST_OPTIONS.mockID = 0; + + addIdsToBlocks(testCase.content); + + await expect( + await editor.blocksToMarkdownLossy(testCase.content), + ).toMatchFileSnapshot(`./__snapshots__/markdown/${testCase.name}.md`); +}; diff --git a/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportNodes.ts b/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportNodes.ts new file mode 100644 index 0000000000..d50856e89f --- /dev/null +++ b/tests/src/unit/testTypes/formatConversion/export/textExecutors/testExportNodes.ts @@ -0,0 +1,30 @@ +import { + BlockNoteEditor, + BlockSchema, + blockToNode, + InlineContentSchema, + StyleSchema, +} from "@blocknote/core"; +import { expect } from "vitest"; + +import { addIdsToBlocks } from "../../formatConversionTestUtil.js"; +import { ExportTestCase } from "../exportTestCase.js"; + +export const testExportNodes = async < + B extends BlockSchema, + I extends InlineContentSchema, + S extends StyleSchema, +>( + editor: BlockNoteEditor, + testCase: ExportTestCase, +) => { + (window as any).__TEST_OPTIONS.mockID = 0; + + addIdsToBlocks(testCase.content); + + await expect( + testCase.content.map((block) => + blockToNode(block, editor.pmSchema, editor.schema.styleSchema), + ), + ).toMatchFileSnapshot(`./__snapshots__/nodes/${testCase.name}.json`); +}; diff --git a/tests/src/unit/shared/formatConversion/exportParseEquality/exportParseEqualityTestCase.ts b/tests/src/unit/testTypes/formatConversion/exportParseEquality/exportParseEqualityTestCase.ts similarity index 100% rename from tests/src/unit/shared/formatConversion/exportParseEquality/exportParseEqualityTestCase.ts rename to tests/src/unit/testTypes/formatConversion/exportParseEquality/exportParseEqualityTestCase.ts diff --git a/tests/src/unit/shared/formatConversion/exportParseEquality/exportParseEqualityTestExecutors.ts b/tests/src/unit/testTypes/formatConversion/exportParseEquality/exportParseEqualityTestExecutors.ts similarity index 100% rename from tests/src/unit/shared/formatConversion/exportParseEquality/exportParseEqualityTestExecutors.ts rename to tests/src/unit/testTypes/formatConversion/exportParseEquality/exportParseEqualityTestExecutors.ts diff --git a/tests/src/unit/shared/formatConversion/formatConversionTestUtil.ts b/tests/src/unit/testTypes/formatConversion/formatConversionTestUtil.ts similarity index 81% rename from tests/src/unit/shared/formatConversion/formatConversionTestUtil.ts rename to tests/src/unit/testTypes/formatConversion/formatConversionTestUtil.ts index 8eea1129df..5ae8997161 100644 --- a/tests/src/unit/shared/formatConversion/formatConversionTestUtil.ts +++ b/tests/src/unit/testTypes/formatConversion/formatConversionTestUtil.ts @@ -17,6 +17,8 @@ import { TableContent, UniqueID, } from "@blocknote/core"; +import { Entry, TextWriter } from "@zip.js/zip.js"; +import xmlFormat from "xml-formatter"; function textShorthandToStyledText( content: string | StyledText[] = "", @@ -197,3 +199,38 @@ export function addIdsToBlocks(blocks: PartialBlock[]) { addIdsToBlock(block); } } + +export function getZIPEntryContent(entries: Entry[], fileName: string) { + const entry = entries.find((entry) => { + return entry.filename === fileName; + }); + + if (!entry) { + return ""; + } + + return entry.getData!(new TextWriter()); +} + +export function prettify(sourceXml: string) { + let ret = xmlFormat(sourceXml); + + // replace random ids like r:id="rIdll8_ocxarmodcwrnsavfb" + ret = ret.replace(/r:id="[a-zA-Z0-9_-]*"/g, 'r:id="FAKE-ID"'); + + // replace random ids like Id="rIdll8_ocxarmodcwrnsavfb" + ret = ret.replace(/ Id="[a-zA-Z0-9_-]*"/g, ' Id="FAKE-ID"'); + + // replace created date ... + ret = ret.replace( + /[^<]*<\/dcterms:created>/g, + 'FAKE-DATE', + ); + + // replace modified date ... + ret = ret.replace( + /[^<]*<\/dcterms:modified>/g, + 'FAKE-DATE', + ); + return ret; +} diff --git a/tests/src/unit/shared/formatConversion/parse/parseTestCase.ts b/tests/src/unit/testTypes/formatConversion/parse/parseTestCase.ts similarity index 100% rename from tests/src/unit/shared/formatConversion/parse/parseTestCase.ts rename to tests/src/unit/testTypes/formatConversion/parse/parseTestCase.ts diff --git a/tests/src/unit/shared/formatConversion/parse/parseTestExecutors.ts b/tests/src/unit/testTypes/formatConversion/parse/parseTestExecutors.ts similarity index 100% rename from tests/src/unit/shared/formatConversion/parse/parseTestExecutors.ts rename to tests/src/unit/testTypes/formatConversion/parse/parseTestExecutors.ts diff --git a/tests/src/unit/shared/selection/getSelection/getSelectionTestCase.ts b/tests/src/unit/testTypes/selection/getSelection/getSelectionTestCase.ts similarity index 100% rename from tests/src/unit/shared/selection/getSelection/getSelectionTestCase.ts rename to tests/src/unit/testTypes/selection/getSelection/getSelectionTestCase.ts diff --git a/tests/src/unit/shared/selection/getSelection/getSelectionTestExecutors.ts b/tests/src/unit/testTypes/selection/getSelection/getSelectionTestExecutors.ts similarity index 100% rename from tests/src/unit/shared/selection/getSelection/getSelectionTestExecutors.ts rename to tests/src/unit/testTypes/selection/getSelection/getSelectionTestExecutors.ts diff --git a/tests/src/unit/shared/selection/incrementSelection/incrementSelectionTestCase.ts b/tests/src/unit/testTypes/selection/incrementSelection/incrementSelectionTestCase.ts similarity index 100% rename from tests/src/unit/shared/selection/incrementSelection/incrementSelectionTestCase.ts rename to tests/src/unit/testTypes/selection/incrementSelection/incrementSelectionTestCase.ts diff --git a/tests/src/unit/shared/selection/incrementSelection/incrementSelectionTestExecutors.ts b/tests/src/unit/testTypes/selection/incrementSelection/incrementSelectionTestExecutors.ts similarity index 100% rename from tests/src/unit/shared/selection/incrementSelection/incrementSelectionTestExecutors.ts rename to tests/src/unit/testTypes/selection/incrementSelection/incrementSelectionTestExecutors.ts diff --git a/tests/src/unit/shared/selection/textCursorPosition/textCursorPositionTestCase.ts b/tests/src/unit/testTypes/selection/textCursorPosition/textCursorPositionTestCase.ts similarity index 100% rename from tests/src/unit/shared/selection/textCursorPosition/textCursorPositionTestCase.ts rename to tests/src/unit/testTypes/selection/textCursorPosition/textCursorPositionTestCase.ts diff --git a/tests/src/unit/shared/selection/textCursorPosition/textCursorPositionTestExecutors.ts b/tests/src/unit/testTypes/selection/textCursorPosition/textCursorPositionTestExecutors.ts similarity index 100% rename from tests/src/unit/shared/selection/textCursorPosition/textCursorPositionTestExecutors.ts rename to tests/src/unit/testTypes/selection/textCursorPosition/textCursorPositionTestExecutors.ts diff --git a/tests/src/unit/shared/testUtil.ts b/tests/src/unit/testTypes/testUtil.ts similarity index 100% rename from tests/src/unit/shared/testUtil.ts rename to tests/src/unit/testTypes/testUtil.ts diff --git a/tests/src/unit/xl-docx-exporter/createTestEditor.tsx b/tests/src/unit/xl-docx-exporter/createTestEditor.tsx new file mode 100644 index 0000000000..aecaee3cc1 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/createTestEditor.tsx @@ -0,0 +1,6 @@ +import { BlockNoteEditor } from "@blocknote/core"; + +import { testSchema } from "./testSchema.js"; + +export const createTestEditor = () => () => + ({ schema: testSchema }) as BlockNoteEditor; diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/codeBlock/contains-newlines.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/codeBlock/contains-newlines.html new file mode 100644 index 0000000000..32e032f09d --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/codeBlock/contains-newlines.html @@ -0,0 +1,11 @@ +
+
+
+
+
+          const hello ='world';console.log(hello);
+        
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/codeBlock/defaultLanguage.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/codeBlock/defaultLanguage.html new file mode 100644 index 0000000000..a8fb6870f0 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/codeBlock/defaultLanguage.html @@ -0,0 +1,11 @@ +
+
+
+
+
+          console.log('Hello, world!');
+        
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/codeBlock/empty.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/codeBlock/empty.html new file mode 100644 index 0000000000..7df4533925 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/codeBlock/empty.html @@ -0,0 +1,11 @@ +
+
+
+
+
+          
+        
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/codeBlock/python.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/codeBlock/python.html new file mode 100644 index 0000000000..232edd4914 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/codeBlock/python.html @@ -0,0 +1,11 @@ +
+
+
+
+
+          print('Hello, world!')
+        
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/complex/misc.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/complex/misc.html new file mode 100644 index 0000000000..7587f35366 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/complex/misc.html @@ -0,0 +1,59 @@ +
+
+
+
+

+ + Heading + + + 2 + +

+
+
+
+
+
+

Paragraph

+
+
+
+
+
+
+

+
+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/contextParagraph/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/contextParagraph/basic.html new file mode 100644 index 0000000000..af796236f6 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/contextParagraph/basic.html @@ -0,0 +1,14 @@ +
+
+
+
+
React Context Paragraph
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/basic.html new file mode 100644 index 0000000000..8b4c461a7b --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/basic.html @@ -0,0 +1,14 @@ +
+
+
+
+

React Custom Paragraph

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/lineBreaks.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/lineBreaks.html new file mode 100644 index 0000000000..d26f517577 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/lineBreaks.html @@ -0,0 +1,18 @@ +
+
+
+
+

+ Line 1 +
+ Line 2 +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/nested.html new file mode 100644 index 0000000000..92745a5ecc --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/nested.html @@ -0,0 +1,40 @@ +
+
+
+
+

React Custom Paragraph

+
+
+
+
+
+

Nested React Custom Paragraph 1

+
+
+
+
+
+
+

Nested React Custom Paragraph 2

+
+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/styled.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/styled.html new file mode 100644 index 0000000000..eac21153e9 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/customParagraph/styled.html @@ -0,0 +1,34 @@ +
+
+
+
+

+ Plain + Red Text + Blue Background + + Mixed Colors + +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/basic.html new file mode 100644 index 0000000000..9974d8d975 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/basic.html @@ -0,0 +1,28 @@ +
+
+
+
+
+
+
+ + + +
+

example

+
+

Caption

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/button.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/button.html new file mode 100644 index 0000000000..db235fd792 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/button.html @@ -0,0 +1,20 @@ +
+
+
+
+
+
+
+ + + +
+

Add file

+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/nested.html new file mode 100644 index 0000000000..6553a5c4a8 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/nested.html @@ -0,0 +1,56 @@ +
+
+
+
+
+
+
+ + + +
+

example

+
+

Caption

+
+
+
+
+
+
+
+
+
+ + + +
+

example

+
+

Caption

+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/noCaption.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/noCaption.html new file mode 100644 index 0000000000..48340682e8 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/noCaption.html @@ -0,0 +1,26 @@ +
+
+
+
+
+
+
+ + + +
+

example

+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/noName.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/noName.html new file mode 100644 index 0000000000..47ae5b3bf9 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/file/noName.html @@ -0,0 +1,27 @@ +
+
+
+
+
+
+
+ + + +
+

+
+

Caption

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/fontSize/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/fontSize/basic.html new file mode 100644 index 0000000000..601e2af9c0 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/fontSize/basic.html @@ -0,0 +1,16 @@ +
+
+
+
+

+ This is text with a custom fontSize +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/basic.html new file mode 100644 index 0000000000..ca0de5979f --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/basic.html @@ -0,0 +1,13 @@ +
+
+
+
+

+ Text1 +
+ Text2 +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/between-links.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/between-links.html new file mode 100644 index 0000000000..9e4b427c62 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/between-links.html @@ -0,0 +1,21 @@ +
+
+
+
+

+ Link1 +
+ Link2 +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/end.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/end.html new file mode 100644 index 0000000000..cc08190f01 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/end.html @@ -0,0 +1,12 @@ +
+
+
+
+

+ Text1 +
+

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/link.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/link.html new file mode 100644 index 0000000000..4cae02d67b --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/link.html @@ -0,0 +1,21 @@ +
+
+
+
+

+ Link1 +
+ Link1 +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/multiple.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/multiple.html new file mode 100644 index 0000000000..06a2a6a7e5 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/multiple.html @@ -0,0 +1,15 @@ +
+
+
+
+

+ Text1 +
+ Text2 +
+ Text3 +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/only.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/only.html new file mode 100644 index 0000000000..030fa48828 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/only.html @@ -0,0 +1,11 @@ +
+
+
+
+

+
+

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/start.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/start.html new file mode 100644 index 0000000000..29e2b8ece4 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/start.html @@ -0,0 +1,12 @@ +
+
+
+
+

+
+ Text1 +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/styles.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/styles.html new file mode 100644 index 0000000000..b6b8eadb30 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/hardbreak/styles.html @@ -0,0 +1,13 @@ +
+
+
+
+

+ Text1 +
+ Text2 +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/basic.html new file mode 100644 index 0000000000..fe9509a5e3 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/basic.html @@ -0,0 +1,22 @@ +
+
+
+
+
+
+ example +
+

Caption

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/button.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/button.html new file mode 100644 index 0000000000..250700bb22 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/button.html @@ -0,0 +1,20 @@ +
+
+
+
+
+
+
+ + + +
+

Add image

+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/nested.html new file mode 100644 index 0000000000..90e46213fe --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/nested.html @@ -0,0 +1,42 @@ +
+
+
+
+
+
+ Caption +
+

Caption

+
+
+
+
+
+
+
+
+ Caption +
+

Caption

+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/noCaption.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/noCaption.html new file mode 100644 index 0000000000..2daf51143b --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/noCaption.html @@ -0,0 +1,20 @@ +
+
+
+
+
+
+ example +
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/noName.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/noName.html new file mode 100644 index 0000000000..05bc98c060 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/noName.html @@ -0,0 +1,21 @@ +
+
+
+
+
+
+ Caption +
+

Caption

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/noPreview.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/noPreview.html new file mode 100644 index 0000000000..84f2dbfc76 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/image/noPreview.html @@ -0,0 +1,30 @@ +
+
+
+
+
+
+
+ + + +
+

example

+
+

Caption

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/link/adjacent.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/link/adjacent.html new file mode 100644 index 0000000000..2408c611ac --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/link/adjacent.html @@ -0,0 +1,20 @@ +
+
+
+
+

+ Website + Website2 +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/link/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/link/basic.html new file mode 100644 index 0000000000..3daea90831 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/link/basic.html @@ -0,0 +1,15 @@ +
+
+
+
+

+ Website +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/link/styled.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/link/styled.html new file mode 100644 index 0000000000..2b9d4cb574 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/link/styled.html @@ -0,0 +1,22 @@ +
+
+
+
+

+ + Web + + site +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/lists/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/lists/basic.html new file mode 100644 index 0000000000..3cb5ed5e94 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/lists/basic.html @@ -0,0 +1,58 @@ +
+
+
+
+

Bullet List Item 1

+
+
+
+
+
+
+

Bullet List Item 2

+
+
+
+
+
+
+

Numbered List Item 1

+
+
+
+
+
+
+

Numbered List Item 2

+
+
+
+
+
+
+ +

Check List Item 1

+
+
+
+
+
+
+ +

Check List Item 2

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/lists/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/lists/nested.html new file mode 100644 index 0000000000..f9aaf463f8 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/lists/nested.html @@ -0,0 +1,62 @@ +
+
+
+
+

Bullet List Item 1

+
+
+
+
+
+
+

Bullet List Item 2

+
+
+
+
+
+

Numbered List Item 1

+
+
+
+
+
+
+

Numbered List Item 2

+
+
+
+
+
+ +

Check List Item 1

+
+
+
+
+
+
+ +

Check List Item 2

+
+
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/mention/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/mention/basic.html new file mode 100644 index 0000000000..a4b3e6a87e --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/mention/basic.html @@ -0,0 +1,12 @@ +
+
+
+
+

+ I enjoy working with + @Matthew +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/pageBreak/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/pageBreak/basic.html new file mode 100644 index 0000000000..545ab1bbac --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/pageBreak/basic.html @@ -0,0 +1,9 @@ +
+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/basic.html new file mode 100644 index 0000000000..326c6a037b --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/basic.html @@ -0,0 +1,9 @@ +
+
+
+
+

Paragraph

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/empty.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/empty.html new file mode 100644 index 0000000000..8c0240ae7c --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/empty.html @@ -0,0 +1,9 @@ +
+
+
+
+

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/lineBreaks.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/lineBreaks.html new file mode 100644 index 0000000000..0aa8dffa67 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/lineBreaks.html @@ -0,0 +1,13 @@ +
+
+
+
+

+ Line 1 +
+ Line 2 +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/nested.html new file mode 100644 index 0000000000..7d99f8188d --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/nested.html @@ -0,0 +1,25 @@ +
+
+
+
+

Paragraph

+
+
+
+
+
+

Nested Paragraph 1

+
+
+
+
+
+
+

Nested Paragraph 2

+
+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/styled.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/styled.html new file mode 100644 index 0000000000..5ae4c7b95c --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/paragraph/styled.html @@ -0,0 +1,32 @@ +
+
+
+
+

+ Plain + Red Text + Blue Background + + Mixed Colors + +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/basic.html new file mode 100644 index 0000000000..9974d8d975 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/basic.html @@ -0,0 +1,28 @@ +
+
+
+
+
+
+
+ + + +
+

example

+
+

Caption

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/button.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/button.html new file mode 100644 index 0000000000..db235fd792 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/button.html @@ -0,0 +1,20 @@ +
+
+
+
+
+
+
+ + + +
+

Add file

+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/nested.html new file mode 100644 index 0000000000..6553a5c4a8 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/nested.html @@ -0,0 +1,56 @@ +
+
+
+
+
+
+
+ + + +
+

example

+
+

Caption

+
+
+
+
+
+
+
+
+
+ + + +
+

example

+
+

Caption

+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/noCaption.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/noCaption.html new file mode 100644 index 0000000000..48340682e8 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/noCaption.html @@ -0,0 +1,26 @@ +
+
+
+
+
+
+
+ + + +
+

example

+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/noName.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/noName.html new file mode 100644 index 0000000000..47ae5b3bf9 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactFile/noName.html @@ -0,0 +1,27 @@ +
+
+
+
+
+
+
+ + + +
+

+
+

Caption

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/basic.html new file mode 100644 index 0000000000..fe9509a5e3 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/basic.html @@ -0,0 +1,22 @@ +
+
+
+
+
+
+ example +
+

Caption

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/button.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/button.html new file mode 100644 index 0000000000..250700bb22 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/button.html @@ -0,0 +1,20 @@ +
+
+
+
+
+
+
+ + + +
+

Add image

+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/nested.html new file mode 100644 index 0000000000..59718524c9 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/nested.html @@ -0,0 +1,44 @@ +
+
+
+
+
+
+ example +
+

Caption

+
+
+
+
+
+
+
+
+ example +
+

Caption

+
+
+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/noCaption.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/noCaption.html new file mode 100644 index 0000000000..2daf51143b --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/noCaption.html @@ -0,0 +1,20 @@ +
+
+
+
+
+
+ example +
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/noName.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/noName.html new file mode 100644 index 0000000000..05bc98c060 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/noName.html @@ -0,0 +1,21 @@ +
+
+
+
+
+
+ Caption +
+

Caption

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/noPreview.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/noPreview.html new file mode 100644 index 0000000000..84f2dbfc76 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/reactImage/noPreview.html @@ -0,0 +1,30 @@ +
+
+
+
+
+
+
+ + + +
+

example

+
+

Caption

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/basic.html new file mode 100644 index 0000000000..7491dda1d0 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/basic.html @@ -0,0 +1,14 @@ +
+
+
+
+

React Custom Paragraph

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/nested.html new file mode 100644 index 0000000000..8c2652a4e9 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/nested.html @@ -0,0 +1,40 @@ +
+
+
+
+

Custom React Paragraph

+
+
+
+
+
+

Nested React Custom Paragraph 1

+
+
+
+
+
+
+

Nested React Custom Paragraph 2

+
+
+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/styled.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/styled.html new file mode 100644 index 0000000000..1e27d73e98 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/simpleCustomParagraph/styled.html @@ -0,0 +1,34 @@ +
+
+
+
+

+ Plain + Red Text + Blue Background + + Mixed Colors + +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/small/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/small/basic.html new file mode 100644 index 0000000000..33dcb60c92 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/small/basic.html @@ -0,0 +1,11 @@ +
+
+
+
+

+ This is a small text +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/allColWidths.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/allColWidths.html new file mode 100644 index 0000000000..778749b580 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/allColWidths.html @@ -0,0 +1,43 @@ +
+
+
+
+ + + + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/basic.html new file mode 100644 index 0000000000..a9e249effe --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/basic.html @@ -0,0 +1,43 @@ +
+
+
+
+ + + + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/headerCols.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/headerCols.html new file mode 100644 index 0000000000..6f5dcb8982 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/headerCols.html @@ -0,0 +1,43 @@ +
+
+
+
+ + + + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/headerRows.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/headerRows.html new file mode 100644 index 0000000000..2ce617f949 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/headerRows.html @@ -0,0 +1,43 @@ +
+
+
+
+ + + + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/mixedCellColors.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/mixedCellColors.html new file mode 100644 index 0000000000..8cafca0c72 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/mixedCellColors.html @@ -0,0 +1,55 @@ +
+
+
+
+ + + + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/mixedColWidths.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/mixedColWidths.html new file mode 100644 index 0000000000..a5e5bdf3b4 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/mixedColWidths.html @@ -0,0 +1,43 @@ +
+
+
+
+ + + + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/mixedRowspansAndColspans.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/mixedRowspansAndColspans.html new file mode 100644 index 0000000000..eb7dd2ce02 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/table/mixedRowspansAndColspans.html @@ -0,0 +1,46 @@ +
+
+
+
+ + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/tag/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/tag/basic.html new file mode 100644 index 0000000000..f17714232a --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/blocknoteHTML/tag/basic.html @@ -0,0 +1,15 @@ +
+
+
+
+

+ I love + + # + BlockNote + +

+
+
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/basicBlockTypes.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/basicBlockTypes.json new file mode 100644 index 0000000000..9d20bd5e75 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/basicBlockTypes.json @@ -0,0 +1,142 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Heading 1", + "type": "text" + } + ], + "id": "1", + "props": { + "backgroundColor": "default", + "level": 1, + "textAlignment": "left", + "textColor": "default" + }, + "type": "heading" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Heading 2", + "type": "text" + } + ], + "id": "2", + "props": { + "backgroundColor": "default", + "level": 2, + "textAlignment": "left", + "textColor": "default" + }, + "type": "heading" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Heading 3", + "type": "text" + } + ], + "id": "3", + "props": { + "backgroundColor": "default", + "level": 3, + "textAlignment": "left", + "textColor": "default" + }, + "type": "heading" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Paragraph", + "type": "text" + } + ], + "id": "4", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default" + }, + "type": "paragraph" + }, + { + "children": [], + "content": undefined, + "id": "5", + "props": { + "backgroundColor": "default", + "caption": "Image Caption", + "name": "", + "showPreview": true, + "textAlignment": "left", + "url": "exampleURL" + }, + "type": "image" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "None ", + "type": "text" + }, + { + "styles": { + "bold": true + }, + "text": "Bold ", + "type": "text" + }, + { + "styles": { + "italic": true + }, + "text": "Italic ", + "type": "text" + }, + { + "styles": { + "underline": true + }, + "text": "Underline ", + "type": "text" + }, + { + "styles": { + "strike": true + }, + "text": "Strikethrough ", + "type": "text" + }, + { + "styles": { + "bold": true, + "italic": true, + "strike": true, + "underline": true + }, + "text": "All", + "type": "text" + } + ], + "id": "6", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default" + }, + "type": "paragraph" + } +] diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlock/contains-newlines.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlock/contains-newlines.html new file mode 100644 index 0000000000..1b766eb380 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlock/contains-newlines.html @@ -0,0 +1,8 @@ +
+  
+    const hello ='world';
+    
+ console.log(hello); +
+
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlock/defaultLanguage.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlock/defaultLanguage.html new file mode 100644 index 0000000000..c5939c1b5e --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlock/defaultLanguage.html @@ -0,0 +1,3 @@ +
+  console.log('Hello, world!');
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlock/empty.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlock/empty.html new file mode 100644 index 0000000000..9bbe62c374 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlock/empty.html @@ -0,0 +1,3 @@ +
+  
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlock/python.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlock/python.html new file mode 100644 index 0000000000..2d95c0d45d --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlock/python.html @@ -0,0 +1,3 @@ +
+  print('Hello, world!')
+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlocks.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlocks.json new file mode 100644 index 0000000000..f9bd791440 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/codeBlocks.json @@ -0,0 +1,62 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "console.log("Should default to JS")", + "type": "text", + }, + ], + "id": "1", + "props": { + "language": "text", + }, + "type": "codeBlock", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "console.log("Should parse TS from data-language")", + "type": "text", + }, + ], + "id": "2", + "props": { + "language": "typescript", + }, + "type": "codeBlock", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "print("Should parse Python from language- class")", + "type": "text", + }, + ], + "id": "3", + "props": { + "language": "python", + }, + "type": "codeBlock", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "console.log("Should prioritize TS from data-language over language- class")", + "type": "text", + }, + ], + "id": "4", + "props": { + "language": "typescript", + }, + "type": "codeBlock", + }, +] \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/complex/misc.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/complex/misc.html new file mode 100644 index 0000000000..0df8a18343 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/complex/misc.html @@ -0,0 +1,14 @@ +

+ + Heading + + + 2 + +

+

Paragraph

+
    +
  • +

    +
  • +
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/contextParagraph/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/contextParagraph/basic.html new file mode 100644 index 0000000000..ab7b9626c9 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/contextParagraph/basic.html @@ -0,0 +1 @@ +
React Context Paragraph
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/customParagraph/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/customParagraph/basic.html new file mode 100644 index 0000000000..2971f11056 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/customParagraph/basic.html @@ -0,0 +1 @@ +

Hello World

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/customParagraph/lineBreaks.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/customParagraph/lineBreaks.html new file mode 100644 index 0000000000..2971f11056 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/customParagraph/lineBreaks.html @@ -0,0 +1 @@ +

Hello World

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/customParagraph/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/customParagraph/nested.html new file mode 100644 index 0000000000..6b2e1554cf --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/customParagraph/nested.html @@ -0,0 +1,3 @@ +

Hello World

+

Hello World

+

Hello World

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/customParagraph/styled.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/customParagraph/styled.html new file mode 100644 index 0000000000..77e2409a54 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/customParagraph/styled.html @@ -0,0 +1,6 @@ +

Hello World

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/deepNestedContent.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/deepNestedContent.json new file mode 100644 index 0000000000..51437ec842 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/deepNestedContent.json @@ -0,0 +1,242 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Outer 1 Div Before", + "type": "text" + } + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default" + }, + "type": "paragraph" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " Outer 2 Div Before", + "type": "text" + } + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default" + }, + "type": "paragraph" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " Outer 3 Div Before", + "type": "text" + } + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default" + }, + "type": "paragraph" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " Outer 4 Div Before", + "type": "text" + } + ], + "id": "4", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default" + }, + "type": "paragraph" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Heading 1", + "type": "text" + } + ], + "id": "5", + "props": { + "backgroundColor": "default", + "level": 1, + "textAlignment": "left", + "textColor": "default" + }, + "type": "heading" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Heading 2", + "type": "text" + } + ], + "id": "6", + "props": { + "backgroundColor": "default", + "level": 2, + "textAlignment": "left", + "textColor": "default" + }, + "type": "heading" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Heading 3", + "type": "text" + } + ], + "id": "7", + "props": { + "backgroundColor": "default", + "level": 3, + "textAlignment": "left", + "textColor": "default" + }, + "type": "heading" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Paragraph", + "type": "text" + } + ], + "id": "8", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default" + }, + "type": "paragraph" + }, + { + "children": [], + "content": undefined, + "id": "9", + "props": { + "backgroundColor": "default", + "caption": "Image Caption", + "name": "", + "showPreview": true, + "textAlignment": "left", + "url": "exampleURL" + }, + "type": "image" + }, + { + "children": [], + "content": [ + { + "styles": { + "bold": true + }, + "text": "Bold", + "type": "text" + }, + { + "styles": {}, + "text": " ", + "type": "text" + }, + { + "styles": { + "italic": true + }, + "text": "Italic", + "type": "text" + }, + { + "styles": {}, + "text": " ", + "type": "text" + }, + { + "styles": { + "underline": true + }, + "text": "Underline", + "type": "text" + }, + { + "styles": {}, + "text": " ", + "type": "text" + }, + { + "styles": { + "strike": true + }, + "text": "Strikethrough", + "type": "text" + }, + { + "styles": {}, + "text": " ", + "type": "text" + }, + { + "styles": { + "bold": true, + "italic": true, + "strike": true, + "underline": true + }, + "text": "All", + "type": "text" + } + ], + "id": "10", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default" + }, + "type": "paragraph" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " Outer 4 Div After Outer 3 Div After Outer 2 Div After Outer 1 Div After", + "type": "text" + } + ], + "id": "11", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default" + }, + "type": "paragraph" + } +] diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/divs.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/divs.json new file mode 100644 index 0000000000..1e08669f16 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/divs.json @@ -0,0 +1,121 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Single Div", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " Div", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Div", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Div", + "type": "text", + }, + ], + "id": "4", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Single Div 2", + "type": "text", + }, + ], + "id": "5", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Div", + "type": "text", + }, + ], + "id": "6", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Div", + "type": "text", + }, + ], + "id": "7", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, +] \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/fakeImageCaption.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/fakeImageCaption.json new file mode 100644 index 0000000000..a6c6dc1379 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/fakeImageCaption.json @@ -0,0 +1,33 @@ +[ + { + "children": [], + "content": undefined, + "id": "1", + "props": { + "backgroundColor": "default", + "caption": "", + "name": "", + "showPreview": true, + "textAlignment": "left", + "url": "exampleURL" + }, + "type": "image" + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Image Caption", + "type": "text" + } + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default" + }, + "type": "paragraph" + } +] diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/basic.html new file mode 100644 index 0000000000..22fe1c373a --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/basic.html @@ -0,0 +1,4 @@ +
+ example +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/button.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/button.html new file mode 100644 index 0000000000..cc675c57a7 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/button.html @@ -0,0 +1 @@ +

Add file

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/nested.html new file mode 100644 index 0000000000..226ee83250 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/nested.html @@ -0,0 +1,8 @@ +
+ example +

Caption

+
+
+ example +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/noCaption.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/noCaption.html new file mode 100644 index 0000000000..e1c8211b39 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/noCaption.html @@ -0,0 +1 @@ +example \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/noName.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/noName.html new file mode 100644 index 0000000000..f0ac923a66 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/file/noName.html @@ -0,0 +1,4 @@ +
+ exampleURL +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/fontSize/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/fontSize/basic.html new file mode 100644 index 0000000000..b8842df250 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/fontSize/basic.html @@ -0,0 +1,8 @@ +

+ This is text with a custom fontSize +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/googleDocs.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/googleDocs.json new file mode 100644 index 0000000000..5a7912dcd1 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/googleDocs.json @@ -0,0 +1,579 @@ +[ + { + "children": [], + "content": [ + { + "styles": { + "bold": true, + }, + "text": "Heading 1", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "level": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "heading", + }, + { + "children": [], + "content": [ + { + "styles": { + "bold": true, + }, + "text": "Heading 2", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "level": 2, + "textAlignment": "left", + "textColor": "default", + }, + "type": "heading", + }, + { + "children": [], + "content": [ + { + "styles": { + "bold": true, + }, + "text": "Heading 3", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "level": 3, + "textAlignment": "left", + "textColor": "default", + }, + "type": "heading", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Paragraph 1", + "type": "text", + }, + ], + "id": "4", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Paragraph 2", + "type": "text", + }, + ], + "id": "5", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Paragraph 3", + "type": "text", + }, + ], + "id": "6", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Paragraph With +Hard Break", + "type": "text", + }, + ], + "id": "7", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": { + "bold": true, + }, + "text": "Bold", + "type": "text", + }, + { + "styles": {}, + "text": " ", + "type": "text", + }, + { + "styles": { + "italic": true, + }, + "text": "Italic", + "type": "text", + }, + { + "styles": {}, + "text": " Underline ", + "type": "text", + }, + { + "styles": { + "strike": true, + }, + "text": "Strikethrough", + "type": "text", + }, + { + "styles": {}, + "text": " ", + "type": "text", + }, + { + "styles": { + "bold": true, + "italic": true, + "strike": true, + }, + "text": "All", + "type": "text", + }, + ], + "id": "8", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": " Nested Numbered List Item 1", + "type": "text", + }, + ], + "id": "11", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " Nested Numbered List Item 2", + "type": "text", + }, + ], + "id": "12", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": " Nested Bullet List Item 1", + "type": "text", + }, + ], + "id": "10", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " Nested Bullet List Item 2", + "type": "text", + }, + ], + "id": "13", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": " Bullet List Item 1", + "type": "text", + }, + ], + "id": "9", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " Bullet List Item 2", + "type": "text", + }, + ], + "id": "14", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " Numbered List Item 1", + "type": "text", + }, + ], + "id": "15", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " Numbered List Item 2", + "type": "text", + }, + ], + "id": "16", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": undefined, + "id": "17", + "props": { + "backgroundColor": "default", + "caption": "", + "name": "", + "previewWidth": 447, + "showPreview": true, + "textAlignment": "left", + "url": "https://lh7-us.googleusercontent.com/SGyYp6hfLvNkli62NKFJB6NQz-fNa2Sjy8QxfUuqipW--qCCXmCz-dJmeZUGaDXIF9TEZHzbhNJsw4_w-B09eaFOn0oUChKsrSt3cwAIFu6d4SoSjHTR_DRTPr415_P7an7Lue-EwlUcVBk1WCzcoVQ", + }, + "type": "image", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " +", + "type": "text", + }, + ], + "id": "18", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": { + "columnWidths": [ + undefined, + undefined, + undefined, + ], + "headerCols": undefined, + "headerRows": undefined, + "rows": [ + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Cell 1", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + { + "content": [ + { + "styles": {}, + "text": "Cell 2", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + { + "content": [ + { + "styles": {}, + "text": "Cell 3", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Cell 4", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + { + "content": [ + { + "styles": {}, + "text": "Cell 5", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + { + "content": [ + { + "styles": {}, + "text": "Cell 6", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Cell 7", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + { + "content": [ + { + "styles": {}, + "text": "Cell 8", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + { + "content": [ + { + "styles": {}, + "text": "Cell 9", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + ], + "type": "tableContent", + }, + "id": "19", + "props": { + "textColor": "default", + }, + "type": "table", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Paragraph", + "type": "text", + }, + ], + "id": "20", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": " +", + "type": "text", + }, + ], + "id": "21", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, +] \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/basic.html new file mode 100644 index 0000000000..d0444869cc --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/basic.html @@ -0,0 +1,5 @@ +

+ Text1 +
+ Text2 +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/between-links.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/between-links.html new file mode 100644 index 0000000000..701b5d4213 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/between-links.html @@ -0,0 +1,13 @@ +

+ Link1 +
+ Link2 +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/end.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/end.html new file mode 100644 index 0000000000..1f7bcf996b --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/end.html @@ -0,0 +1,4 @@ +

+ Text1 +
+

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/link.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/link.html new file mode 100644 index 0000000000..2c762aedc5 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/link.html @@ -0,0 +1,13 @@ +

+ Link1 +
+ Link1 +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/multiple.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/multiple.html new file mode 100644 index 0000000000..5d957daa62 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/multiple.html @@ -0,0 +1,7 @@ +

+ Text1 +
+ Text2 +
+ Text3 +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/only.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/only.html new file mode 100644 index 0000000000..b96f89d7a0 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/only.html @@ -0,0 +1,3 @@ +

+
+

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/start.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/start.html new file mode 100644 index 0000000000..f0370a6c68 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/start.html @@ -0,0 +1,4 @@ +

+
+ Text1 +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/styles.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/styles.html new file mode 100644 index 0000000000..7a49318b49 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/hardbreak/styles.html @@ -0,0 +1,5 @@ +

+ Text1 +
+ Text2 +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/basic.html new file mode 100644 index 0000000000..59f782dbb1 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/basic.html @@ -0,0 +1,9 @@ +
+ example +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/button.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/button.html new file mode 100644 index 0000000000..8553433aff --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/button.html @@ -0,0 +1 @@ +

Add image

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/nested.html new file mode 100644 index 0000000000..8cc825084e --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/nested.html @@ -0,0 +1,8 @@ +
+ exampleURL +

Caption

+
+
+ exampleURL +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/noCaption.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/noCaption.html new file mode 100644 index 0000000000..269bdeca7e --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/noCaption.html @@ -0,0 +1,6 @@ +example \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/noName.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/noName.html new file mode 100644 index 0000000000..decd178fbe --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/noName.html @@ -0,0 +1,4 @@ +
+ exampleURL +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/noPreview.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/noPreview.html new file mode 100644 index 0000000000..21bf2faaf1 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/image/noPreview.html @@ -0,0 +1,10 @@ +
+ example +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/imageInParagraph.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/imageInParagraph.json new file mode 100644 index 0000000000..48faecbe6d --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/imageInParagraph.json @@ -0,0 +1,16 @@ +[ + { + "children": [], + "content": undefined, + "id": "1", + "props": { + "backgroundColor": "default", + "caption": "", + "name": "", + "showPreview": true, + "textAlignment": "left", + "url": "exampleURL" + }, + "type": "image" + } +] diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/inlineContentAndNestedBlocks.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/inlineContentAndNestedBlocks.json new file mode 100644 index 0000000000..b21c97408c --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/inlineContentAndNestedBlocks.json @@ -0,0 +1,91 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "None ", + "type": "text", + }, + { + "styles": { + "bold": true, + }, + "text": "Bold ", + "type": "text", + }, + { + "styles": { + "italic": true, + }, + "text": "Italic ", + "type": "text", + }, + { + "styles": { + "underline": true, + }, + "text": "Underline ", + "type": "text", + }, + { + "styles": { + "strike": true, + }, + "text": "Strikethrough ", + "type": "text", + }, + { + "styles": { + "bold": true, + "italic": true, + "strike": true, + "underline": true, + }, + "text": "All", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Div", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Paragraph", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, +] \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/link/adjacent.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/link/adjacent.html new file mode 100644 index 0000000000..db99691d33 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/link/adjacent.html @@ -0,0 +1,12 @@ +

+ Website + Website2 +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/link/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/link/basic.html new file mode 100644 index 0000000000..4b61e8c582 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/link/basic.html @@ -0,0 +1,7 @@ +

+ Website +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/link/styled.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/link/styled.html new file mode 100644 index 0000000000..fb7737f7f8 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/link/styled.html @@ -0,0 +1,14 @@ +

+ + Web + + site +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/lists.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/lists.json new file mode 100644 index 0000000000..cdd50b6d47 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/lists.json @@ -0,0 +1,177 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "First", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Second", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Third", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Fourth", + "type": "text", + }, + ], + "id": "4", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Fifth", + "type": "text", + }, + ], + "id": "5", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Child 1", + "type": "text", + }, + ], + "id": "7", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Child 2", + "type": "text", + }, + ], + "id": "8", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Child 3", + "type": "text", + }, + ], + "id": "9", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Child 4", + "type": "text", + }, + ], + "id": "10", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": "Five Parent", + "type": "text", + }, + ], + "id": "6", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/lists/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/lists/basic.html new file mode 100644 index 0000000000..aee1048a87 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/lists/basic.html @@ -0,0 +1,26 @@ +
    +
  • +

    Bullet List Item 1

    +
  • +
  • +

    Bullet List Item 2

    +
  • +
+
    +
  1. +

    Numbered List Item 1

    +
  2. +
  3. +

    Numbered List Item 2

    +
  4. +
+
    +
  • + +

    Check List Item 1

    +
  • +
  • + +

    Check List Item 2

    +
  • +
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/lists/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/lists/nested.html new file mode 100644 index 0000000000..b2497ae937 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/lists/nested.html @@ -0,0 +1,26 @@ +
    +
  • +

    Bullet List Item 1

    +
  • +
  • +

    Bullet List Item 2

    +
      +
    1. +

      Numbered List Item 1

      +
    2. +
    3. +

      Numbered List Item 2

      +
        +
      • + +

        Check List Item 1

        +
      • +
      • + +

        Check List Item 2

        +
      • +
      +
    4. +
    +
  • +
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/mention/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/mention/basic.html new file mode 100644 index 0000000000..dba0d5cf95 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/mention/basic.html @@ -0,0 +1,4 @@ +

+ I enjoy working with + @Matthew +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/mixedNestedLists.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/mixedNestedLists.json new file mode 100644 index 0000000000..5b79ba865f --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/mixedNestedLists.json @@ -0,0 +1,265 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Numbered List Item", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Numbered List Item", + "type": "text", + }, + ], + "id": "4", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "5", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Numbered List Item", + "type": "text", + }, + ], + "id": "6", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Check List Item", + "type": "text", + }, + ], + "id": "8", + "props": { + "backgroundColor": "default", + "checked": true, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Check List Item", + "type": "text", + }, + ], + "id": "9", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": "Numbered List Item", + "type": "text", + }, + ], + "id": "7", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Numbered List Item", + "type": "text", + }, + ], + "id": "10", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Check List Item", + "type": "text", + }, + ], + "id": "11", + "props": { + "backgroundColor": "default", + "checked": true, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Bullet List Item", + "type": "text", + }, + ], + "id": "13", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Bullet List Item", + "type": "text", + }, + ], + "id": "14", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": "Check List Item", + "type": "text", + }, + ], + "id": "12", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Check List Item", + "type": "text", + }, + ], + "id": "15", + "props": { + "backgroundColor": "default", + "checked": true, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/nestedLists.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/nestedLists.json new file mode 100644 index 0000000000..061ca1c5bc --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/nestedLists.json @@ -0,0 +1,265 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Bullet List Item", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Bullet List Item", + "type": "text", + }, + ], + "id": "4", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "5", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Numbered List Item", + "type": "text", + }, + ], + "id": "6", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Numbered List Item", + "type": "text", + }, + ], + "id": "8", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Numbered List Item", + "type": "text", + }, + ], + "id": "9", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": "Numbered List Item", + "type": "text", + }, + ], + "id": "7", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Numbered List Item", + "type": "text", + }, + ], + "id": "10", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Check List Item", + "type": "text", + }, + ], + "id": "11", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Check List Item", + "type": "text", + }, + ], + "id": "13", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Check List Item", + "type": "text", + }, + ], + "id": "14", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": "Check List Item", + "type": "text", + }, + ], + "id": "12", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Check List Item", + "type": "text", + }, + ], + "id": "15", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/nestedListsWithParagraphs.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/nestedListsWithParagraphs.json new file mode 100644 index 0000000000..055d8f7d31 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/nestedListsWithParagraphs.json @@ -0,0 +1,265 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Bullet List Item", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Bullet List Item", + "type": "text", + }, + ], + "id": "4", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item", + "type": "text", + }, + ], + "id": "5", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Numbered List Item", + "type": "text", + }, + ], + "id": "6", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Numbered List Item", + "type": "text", + }, + ], + "id": "8", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Numbered List Item", + "type": "text", + }, + ], + "id": "9", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": "Numbered List Item", + "type": "text", + }, + ], + "id": "7", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Numbered List Item", + "type": "text", + }, + ], + "id": "10", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Checked List Item", + "type": "text", + }, + ], + "id": "11", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Checked List Item", + "type": "text", + }, + ], + "id": "13", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Checked List Item", + "type": "text", + }, + ], + "id": "14", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": "Checked List Item", + "type": "text", + }, + ], + "id": "12", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Checked List Item", + "type": "text", + }, + ], + "id": "15", + "props": { + "backgroundColor": "default", + "checked": false, + "textAlignment": "left", + "textColor": "default", + }, + "type": "checkListItem", + }, +] \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/notion.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/notion.json new file mode 100644 index 0000000000..b1eb97dd2d --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/notion.json @@ -0,0 +1,566 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Heading 1", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "level": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "heading", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Heading 2", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "level": 2, + "textAlignment": "left", + "textColor": "default", + }, + "type": "heading", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Heading 3", + "type": "text", + }, + ], + "id": "3", + "props": { + "backgroundColor": "default", + "level": 3, + "textAlignment": "left", + "textColor": "default", + }, + "type": "heading", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Paragraph 1", + "type": "text", + }, + ], + "id": "4", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Paragraph 1", + "type": "text", + }, + ], + "id": "5", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Paragraph 2", + "type": "text", + }, + ], + "id": "6", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Paragraph With Hard Break", + "type": "text", + }, + ], + "id": "7", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": { + "bold": true, + }, + "text": "Bold", + "type": "text", + }, + { + "styles": {}, + "text": " ", + "type": "text", + }, + { + "styles": { + "italic": true, + }, + "text": "Italic", + "type": "text", + }, + { + "styles": {}, + "text": " Underline ", + "type": "text", + }, + { + "styles": { + "strike": true, + }, + "text": "Strikethrough", + "type": "text", + }, + { + "styles": {}, + "text": " ", + "type": "text", + }, + { + "styles": { + "bold": true, + "italic": true, + "strike": true, + }, + "text": "All", + "type": "text", + }, + ], + "id": "8", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [ + { + "children": [ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Numbered List Item 1", + "type": "text", + }, + ], + "id": "11", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Numbered List Item 2", + "type": "text", + }, + ], + "id": "12", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": "Nested Bullet List Item 1", + "type": "text", + }, + ], + "id": "10", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Nested Bullet List Item 2", + "type": "text", + }, + ], + "id": "13", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + ], + "content": [ + { + "styles": {}, + "text": "Bullet List Item 1", + "type": "text", + }, + ], + "id": "9", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bullet List Item 2", + "type": "text", + }, + ], + "id": "14", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "bulletListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Numbered List Item 1", + "type": "text", + }, + ], + "id": "15", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Numbered List Item 2", + "type": "text", + }, + ], + "id": "16", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "numberedListItem", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Background Color Paragraph", + "type": "text", + }, + ], + "id": "17", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "!", + "type": "text", + }, + { + "content": [ + { + "styles": {}, + "text": "https://www.pulsecarshalton.co.uk/wp-content/uploads/2016/08/jk-placeholder-image.jpg", + "type": "text", + }, + ], + "href": "https://www.pulsecarshalton.co.uk/wp-content/uploads/2016/08/jk-placeholder-image.jpg", + "type": "link", + }, + ], + "id": "18", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": { + "columnWidths": [ + undefined, + undefined, + undefined, + ], + "headerCols": undefined, + "headerRows": 1, + "rows": [ + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Cell 1", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + { + "content": [ + { + "styles": {}, + "text": "Cell 2", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + { + "content": [ + { + "styles": {}, + "text": "Cell 3", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Cell 4", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + { + "content": [ + { + "styles": {}, + "text": "Cell 5", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + { + "content": [ + { + "styles": {}, + "text": "Cell 6", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "Cell 7", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + { + "content": [ + { + "styles": {}, + "text": "Cell 8", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + { + "content": [ + { + "styles": {}, + "text": "Cell 9", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + ], + "type": "tableContent", + }, + "id": "19", + "props": { + "textColor": "default", + }, + "type": "table", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Paragraph", + "type": "text", + }, + ], + "id": "20", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, +] \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/pageBreak/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/pageBreak/basic.html new file mode 100644 index 0000000000..ba65bb0620 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/pageBreak/basic.html @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/basic.html new file mode 100644 index 0000000000..38addeaada --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/basic.html @@ -0,0 +1 @@ +

Paragraph

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/empty.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/empty.html new file mode 100644 index 0000000000..540135ad6a --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/empty.html @@ -0,0 +1 @@ +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/lineBreaks.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/lineBreaks.html new file mode 100644 index 0000000000..7dafa23c42 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/lineBreaks.html @@ -0,0 +1,5 @@ +

+ Line 1 +
+ Line 2 +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/nested.html new file mode 100644 index 0000000000..5e80eb83e2 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/nested.html @@ -0,0 +1,3 @@ +

Paragraph

+

Nested Paragraph 1

+

Nested Paragraph 2

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/styled.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/styled.html new file mode 100644 index 0000000000..65e55c08bf --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/paragraph/styled.html @@ -0,0 +1,12 @@ +

+ Plain + Red Text + Blue Background + + Mixed Colors + +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/basic.html new file mode 100644 index 0000000000..22fe1c373a --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/basic.html @@ -0,0 +1,4 @@ +
+ example +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/button.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/button.html new file mode 100644 index 0000000000..cc675c57a7 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/button.html @@ -0,0 +1 @@ +

Add file

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/nested.html new file mode 100644 index 0000000000..226ee83250 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/nested.html @@ -0,0 +1,8 @@ +
+ example +

Caption

+
+
+ example +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/noCaption.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/noCaption.html new file mode 100644 index 0000000000..e1c8211b39 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/noCaption.html @@ -0,0 +1 @@ +example \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/noName.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/noName.html new file mode 100644 index 0000000000..f0ac923a66 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactFile/noName.html @@ -0,0 +1,4 @@ +
+ exampleURL +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/basic.html new file mode 100644 index 0000000000..59f782dbb1 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/basic.html @@ -0,0 +1,9 @@ +
+ example +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/button.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/button.html new file mode 100644 index 0000000000..8553433aff --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/button.html @@ -0,0 +1 @@ +

Add image

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/nested.html new file mode 100644 index 0000000000..39c365984d --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/nested.html @@ -0,0 +1,18 @@ +
+ example +

Caption

+
+
+ example +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/noCaption.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/noCaption.html new file mode 100644 index 0000000000..269bdeca7e --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/noCaption.html @@ -0,0 +1,6 @@ +example \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/noName.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/noName.html new file mode 100644 index 0000000000..decd178fbe --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/noName.html @@ -0,0 +1,4 @@ +
+ exampleURL +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/noPreview.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/noPreview.html new file mode 100644 index 0000000000..21bf2faaf1 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/reactImage/noPreview.html @@ -0,0 +1,10 @@ +
+ example +

Caption

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/simpleCustomParagraph/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/simpleCustomParagraph/basic.html new file mode 100644 index 0000000000..a12e18e1e3 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/simpleCustomParagraph/basic.html @@ -0,0 +1 @@ +

React Custom Paragraph

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/simpleCustomParagraph/nested.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/simpleCustomParagraph/nested.html new file mode 100644 index 0000000000..1fa764aff8 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/simpleCustomParagraph/nested.html @@ -0,0 +1,3 @@ +

Custom React Paragraph

+

Nested React Custom Paragraph 1

+

Nested React Custom Paragraph 2

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/simpleCustomParagraph/styled.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/simpleCustomParagraph/styled.html new file mode 100644 index 0000000000..6d94787359 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/simpleCustomParagraph/styled.html @@ -0,0 +1,13 @@ +

+ Plain + Red Text + Blue Background + + Mixed Colors + +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/small/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/small/basic.html new file mode 100644 index 0000000000..91b799b7b0 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/small/basic.html @@ -0,0 +1,3 @@ +

+ This is a small text +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/allColWidths.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/allColWidths.html new file mode 100644 index 0000000000..9ce9e3e5c6 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/allColWidths.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/basic.html new file mode 100644 index 0000000000..00f73d172c --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/basic.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/headerCols.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/headerCols.html new file mode 100644 index 0000000000..eeebae59df --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/headerCols.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/headerRows.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/headerRows.html new file mode 100644 index 0000000000..008f208fdc --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/headerRows.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/mixedCellColors.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/mixedCellColors.html new file mode 100644 index 0000000000..05bcfd2bfc --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/mixedCellColors.html @@ -0,0 +1,47 @@ + + + + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/mixedColWidths.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/mixedColWidths.html new file mode 100644 index 0000000000..72d863ebea --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/mixedColWidths.html @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/mixedRowspansAndColspans.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/mixedRowspansAndColspans.html new file mode 100644 index 0000000000..9ec43c73e7 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/table/mixedRowspansAndColspans.html @@ -0,0 +1,38 @@ + + + + + + + + + + + + + +
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
+

Table Cell

+
\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/tag/basic.html b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/tag/basic.html new file mode 100644 index 0000000000..28d8392094 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/tag/basic.html @@ -0,0 +1,7 @@ +

+ I love + + # + BlockNote + +

\ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/twoDivs.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/twoDivs.json new file mode 100644 index 0000000000..e91570e36b --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/twoDivs.json @@ -0,0 +1,36 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Single Div", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, + { + "children": [], + "content": [ + { + "styles": {}, + "text": "second Div", + "type": "text", + }, + ], + "id": "2", + "props": { + "backgroundColor": "default", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, +] \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/twoTables.json b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/twoTables.json new file mode 100644 index 0000000000..3ffbb3ead1 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/__snapshots__/html/twoTables.json @@ -0,0 +1,136 @@ +[ + { + "children": [], + "content": { + "columnWidths": [ + undefined, + ], + "headerCols": undefined, + "headerRows": undefined, + "rows": [ + { + "cells": [ + { + "content": [ + { + "styles": { + "underline": true, + }, + "text": "Company", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + { + "cells": [ + { + "content": [ + { + "styles": { + "bold": true, + }, + "text": "Example Company Inc.", + "type": "text", + }, + { + "styles": {}, + "text": " + +Name: [Company Representative] +Title: Chief Executive Officer", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + ], + "type": "tableContent", + }, + "id": "1", + "props": { + "textColor": "default", + }, + "type": "table", + }, + { + "children": [], + "content": { + "columnWidths": [ + undefined, + ], + "headerCols": undefined, + "headerRows": undefined, + "rows": [ + { + "cells": [ + { + "content": [ + { + "styles": { + "underline": true, + }, + "text": "Advisor", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + { + "cells": [ + { + "content": [ + { + "styles": {}, + "text": "[Advisor Name]", + "type": "text", + }, + ], + "props": { + "backgroundColor": "default", + "colspan": 1, + "rowspan": 1, + "textAlignment": "left", + "textColor": "default", + }, + "type": "tableCell", + }, + ], + }, + ], + "type": "tableContent", + }, + "id": "2", + "props": { + "textColor": "default", + }, + "type": "table", + }, +] \ No newline at end of file diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/exportTestInstances.ts b/tests/src/unit/xl-docx-exporter/formatConversion/export/exportTestInstances.ts new file mode 100644 index 0000000000..12a9fa00b8 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/exportTestInstances.ts @@ -0,0 +1,305 @@ +import { ExportTestCase } from "../../../testTypes/formatConversion/export/exportTestCase.js"; +import { testExportDocX } from "../../../testTypes/formatConversion/export/textExecutors/testExportDocX.js"; +import { testExportDocXOptions } from "../../../testTypes/formatConversion/export/textExecutors/testExportDocXOptions.js"; +import { TestInstance } from "../../../types.js"; +import { + TestBlockSchema, + TestInlineContentSchema, + TestStyleSchema, +} from "../../testSchema.js"; + +export const exportTestInstancesDocX: TestInstance< + ExportTestCase, + TestBlockSchema, + TestInlineContentSchema, + TestStyleSchema +>[] = [ + { + testCase: { + name: "reactFile/button", + content: [ + { + type: "paragraph", + content: [ + { + type: "text", + text: "Welcome to this ", + styles: { + italic: true, + }, + }, + { + type: "text", + text: "demo 🙌!", + styles: { + italic: true, + bold: true, + }, + }, + ], + children: [ + { + type: "paragraph", + content: "Hello World nested", + children: [ + { + type: "paragraph", + content: "Hello World double nested", + }, + ], + }, + ], + }, + { + type: "paragraph", + content: [ + { + type: "text", + text: "This paragraph has a background color", + styles: { bold: true }, + }, + ], + props: { + backgroundColor: "red", + }, + }, + { + type: "paragraph", + content: "Paragraph", + }, + { + type: "heading", + content: "Heading", + }, + { + type: "heading", + content: "Heading right", + props: { + textAlignment: "right", + }, + }, + { + type: "paragraph", + content: + "justified paragraph. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", + + props: { + textAlignment: "justify", + }, + }, + { type: "pageBreak" }, + { + type: "bulletListItem", + content: + "Bullet List Item. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", + children: [ + { + type: "bulletListItem", + content: + "Bullet List Item. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", + }, + { + type: "bulletListItem", + content: + "Bullet List Item right. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.", + props: { + textAlignment: "right", + }, + }, + { + type: "numberedListItem", + content: "Numbered List Item 1", + }, + { + type: "numberedListItem", + content: "Numbered List Item 2", + children: [ + { + type: "numberedListItem", + content: "Numbered List Item Nested 1", + }, + { + type: "numberedListItem", + content: "Numbered List Item Nested 2", + }, + { + type: "numberedListItem", + content: "Numbered List Item Nested funky right", + props: { + textAlignment: "right", + backgroundColor: "red", + textColor: "blue", + }, + }, + { + type: "numberedListItem", + content: "Numbered List Item Nested funky center", + props: { + textAlignment: "center", + backgroundColor: "red", + textColor: "blue", + }, + }, + ], + }, + ], + }, + { + type: "numberedListItem", + content: "Numbered List Item", + }, + { + type: "checkListItem", + content: "Check List Item", + }, + { + type: "table", + content: { + type: "tableContent", + columnWidths: [200, undefined, undefined], + rows: [ + { + cells: ["Wide Cell", "Table Cell", "Table Cell"], + }, + { + cells: ["Wide Cell", "Table Cell", "Table Cell"], + }, + { + cells: ["Wide Cell", "Table Cell", "Table Cell"], + }, + ], + }, + }, + { + type: "file", + }, + { + type: "image", + props: { + url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg", + caption: + "From https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg", + }, + }, + { + type: "image", + props: { + previewWidth: 200, + url: "https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg", + textAlignment: "right", + }, + }, + { + type: "video", + props: { + url: "https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm", + caption: + "From https://interactive-examples.mdn.mozilla.net/media/cc0-videos/flower.webm", + }, + }, + { + type: "audio", + props: { + url: "https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3", + caption: + "From https://interactive-examples.mdn.mozilla.net/media/cc0-audio/t-rex-roar.mp3", + }, + }, + { + type: "paragraph", + }, + { + type: "audio", + props: { + caption: "Audio file caption", + name: "audio.mp3", + }, + }, + { + type: "paragraph", + content: [ + { + type: "text", + text: "Inline Content:", + styles: { bold: true }, + }, + ], + }, + { + type: "paragraph", + content: [ + { + type: "text", + text: "Styled Text", + styles: { + bold: true, + italic: true, + textColor: "red", + backgroundColor: "blue", + }, + }, + { + type: "text", + text: " ", + styles: {}, + }, + { + type: "link", + content: "Link", + href: "https://www.blocknotejs.org", + }, + ], + }, + { + type: "table", + content: { + type: "tableContent", + rows: [ + { + cells: ["Table Cell 1", "Table Cell 2", "Table Cell 3"], + }, + { + cells: [ + "Table Cell 4", + [ + { + type: "text", + text: "Table Cell Bold 5", + styles: { + bold: true, + }, + }, + ], + "Table Cell 6", + ], + }, + { + cells: ["Table Cell 7", "Table Cell 8", "Table Cell 9"], + }, + ], + }, + }, + { + type: "codeBlock", + props: { + language: "javascript", + }, + content: `const helloWorld = (message) => { + console.log("Hello World", message); +};`, + }, + ], + }, + executeTest: testExportDocX, + }, +]; + +export const exportTestInstancesDocXOptions: TestInstance< + ExportTestCase, + TestBlockSchema, + TestInlineContentSchema, + TestStyleSchema +>[] = exportTestInstancesDocX.map(({ testCase }) => ({ + testCase, + executeTest: testExportDocXOptions, +})); diff --git a/tests/src/unit/xl-docx-exporter/formatConversion/export/runTests.test.ts b/tests/src/unit/xl-docx-exporter/formatConversion/export/runTests.test.ts new file mode 100644 index 0000000000..7595d1b455 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/formatConversion/export/runTests.test.ts @@ -0,0 +1,27 @@ +import { describe, it } from "vitest"; + +import { createTestEditor } from "../../createTestEditor.js"; +import { + exportTestInstancesDocX, + exportTestInstancesDocXOptions, +} from "./exportTestInstances.js"; + +describe("Export tests (DocX)", () => { + const getEditor = createTestEditor(); + + for (const { testCase, executeTest } of exportTestInstancesDocX) { + it(`${testCase.name}`, async () => { + await executeTest(getEditor(), testCase); + }); + } +}); + +describe("Export tests (DocX with options)", () => { + const getEditor = createTestEditor(); + + for (const { testCase, executeTest } of exportTestInstancesDocXOptions) { + it(`${testCase.name}`, async () => { + await executeTest(getEditor(), testCase); + }); + } +}); diff --git a/tests/src/unit/xl-docx-exporter/testSchema.tsx b/tests/src/unit/xl-docx-exporter/testSchema.tsx new file mode 100644 index 0000000000..fe666ae098 --- /dev/null +++ b/tests/src/unit/xl-docx-exporter/testSchema.tsx @@ -0,0 +1,12 @@ +import { BlockNoteSchema, defaultBlockSpecs, PageBreak } from "@blocknote/core"; + +export const testSchema = BlockNoteSchema.create({ + blockSpecs: { + ...defaultBlockSpecs, + pageBreak: PageBreak, + }, +}); + +export type TestBlockSchema = typeof testSchema.blockSchema; +export type TestInlineContentSchema = typeof testSchema.inlineContentSchema; +export type TestStyleSchema = typeof testSchema.styleSchema;