diff --git a/packages/core/test/__snapshots__/blockManipulation.test.ts.snap b/packages/core/src/api/blockManipulation/__snapshots__/blockManipulation.test.ts.snap similarity index 100% rename from packages/core/test/__snapshots__/blockManipulation.test.ts.snap rename to packages/core/src/api/blockManipulation/__snapshots__/blockManipulation.test.ts.snap diff --git a/packages/core/test/blockManipulation.test.ts b/packages/core/src/api/blockManipulation/blockManipulation.test.ts similarity index 94% rename from packages/core/test/blockManipulation.test.ts rename to packages/core/src/api/blockManipulation/blockManipulation.test.ts index f13f2f1c13..22b57e58c3 100644 --- a/packages/core/test/blockManipulation.test.ts +++ b/packages/core/src/api/blockManipulation/blockManipulation.test.ts @@ -1,8 +1,8 @@ import { afterEach, beforeEach, describe, expect, it } from "vitest"; -import { Block, BlockNoteEditor, PartialBlock } from "../src"; +import { Block, BlockNoteEditor, PartialBlock } from "../.."; let editor: BlockNoteEditor; -let ready = false; + function waitForEditor() { // wait for create event on editor, // this is necessary because otherwise UniqueId.create hasn't been called yet, and @@ -23,11 +23,7 @@ let insert: (placement: "before" | "nested" | "after") => Block[]; beforeEach(() => { (window as Window & { __TEST_OPTIONS?: {} }).__TEST_OPTIONS = {}; - editor = new BlockNoteEditor({ - onCreate: () => { - ready = true; - }, - }); + editor = new BlockNoteEditor(); singleBlock = { type: "paragraph", @@ -78,9 +74,8 @@ beforeEach(() => { }); afterEach(() => { - ready = false; editor._tiptapEditor.destroy(); - editor = undefined; + editor = undefined as any; delete (window as Window & { __TEST_OPTIONS?: {} }).__TEST_OPTIONS; }); diff --git a/packages/core/test/__snapshots__/formatConversions.test.ts.snap b/packages/core/src/api/formatConversions/__snapshots__/formatConversions.test.ts.snap similarity index 100% rename from packages/core/test/__snapshots__/formatConversions.test.ts.snap rename to packages/core/src/api/formatConversions/__snapshots__/formatConversions.test.ts.snap diff --git a/packages/core/test/formatConversions.test.ts b/packages/core/src/api/formatConversions/formatConversions.test.ts similarity index 90% rename from packages/core/test/formatConversions.test.ts rename to packages/core/src/api/formatConversions/formatConversions.test.ts index 24d2ee1cb8..f93ed6cd08 100644 --- a/packages/core/test/formatConversions.test.ts +++ b/packages/core/src/api/formatConversions/formatConversions.test.ts @@ -1,7 +1,6 @@ -import {Block} from "@blocknote/core"; -import {afterEach, beforeEach, describe, expect, it} from "vitest"; -import { BlockNoteEditor } from "../src"; -import UniqueID from "../src/extensions/UniqueID/UniqueID"; +import { afterEach, beforeEach, describe, expect, it } from "vitest"; +import { Block, BlockNoteEditor } from "../.."; +import UniqueID from "../../extensions/UniqueID/UniqueID"; let editor: BlockNoteEditor; @@ -173,15 +172,15 @@ Paragraph ], }, ]; -// nestedHTML = `
Paragraph
Bullet List Item
Numbered List Item
Paragraph
Bullet List Item
Numbered List Item
Paragraph
Paragraph
Paragraph
Bullet List Item
Bullet List Item
Bullet List Item
Bullet List Item
Paragraph
Numbered List Item
Numbered List Item
Numbered List Item
Numbered List Item
Bullet List Item
Bullet List Item
Bullet List Item
Paragraph
Paragraph
Paragraph
Bullet List Item
Bullet List Item
Bullet List Item
Bullet List Item
Paragraph
Numbered List Item
Numbered List Item
Numbered List Item
Numbered List Item
Bullet List Item
Bullet List Item
Bullet List Item