Skip to content

Commit 1a4801d

Browse files
committed
test: get tests going again
1 parent 2bc825f commit 1a4801d

File tree

3 files changed

+5
-7
lines changed

3 files changed

+5
-7
lines changed

packages/core/src/extensions/Placeholder/PlaceholderPlugin.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ export class PlaceholderPlugin extends BlockNoteExtension {
3232
styleEl.setAttribute("nonce", nonce);
3333
}
3434

35-
if (editor.prosemirrorView?.root instanceof ShadowRoot) {
35+
if (editor.prosemirrorView?.root instanceof window.ShadowRoot) {
3636
editor.prosemirrorView.root.append(styleEl);
3737
} else {
3838
editor.prosemirrorView?.root.head.appendChild(styleEl);
@@ -88,7 +88,7 @@ export class PlaceholderPlugin extends BlockNoteExtension {
8888

8989
return {
9090
destroy: () => {
91-
if (editor.prosemirrorView?.root instanceof ShadowRoot) {
91+
if (editor.prosemirrorView?.root instanceof window.ShadowRoot) {
9292
editor.prosemirrorView.root.removeChild(styleEl);
9393
} else {
9494
editor.prosemirrorView?.root.head.removeChild(styleEl);

packages/server-util/src/context/ServerBlockNoteEditor.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -117,11 +117,9 @@ describe("Test ServerBlockNoteEditor", () => {
117117
});
118118

119119
it("converts to and from yjs (fragment)", async () => {
120-
const fragment = await editor.blocksToYXmlFragment(blocks);
121-
122-
// fragment needs to be part of a Y.Doc before we can use other operations on it
123120
const doc = new Y.Doc();
124-
doc.getMap().set("prosemirror", fragment);
121+
const fragment = doc.getXmlFragment("test");
122+
await editor.blocksToYXmlFragment(blocks, fragment);
125123

126124
const blockOutput = await editor.yXmlFragmentToBlocks(fragment);
127125
expect(blockOutput).toEqual(blocks);
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
22

3-
exports[`Test ServerBlockNoteEditor with React blocks > works for blocks with context 1`] = `"<div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><span></span></div></div></div>"`;
3+
exports[`Test ServerBlockNoteEditor with React blocks > works for blocks with context 1`] = `"<div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="reactContextParagraph" data-node-view-wrapper="" style="white-space: normal;"><div class="bn-inline-content">React Context Paragraph</div></div></div></div></div>"`;
44

55
exports[`Test ServerBlockNoteEditor with React blocks > works for simple blocks 1`] = `"<div class="bn-block-group" data-node-type="blockGroup"><div class="bn-block-outer" data-node-type="blockOuter" data-id="1"><div class="bn-block" data-node-type="blockContainer" data-id="1"><div class="bn-block-content" data-content-type="simpleReactCustomParagraph" data-node-view-wrapper="" style="white-space: normal;"><p class="bn-inline-content simple-react-custom-paragraph">React Custom Paragraph</p></div></div></div></div>"`;

0 commit comments

Comments
 (0)