diff --git a/tests/core/stub-editor/index.js b/tests/core/stub-editor/index.js index d346ad2e..d1c30f64 100644 --- a/tests/core/stub-editor/index.js +++ b/tests/core/stub-editor/index.js @@ -1,4 +1,3 @@ -import { Editor } from 'slate'; import { createSdocEditor, formatChildren2 } from '../utils'; class StubEditor { @@ -8,44 +7,19 @@ class StubEditor { throw new Error('Param input is required'); } this.editor = createSdocEditor(input, plugins); - this.pendingOperationList = []; } getEditor = () => { return this.editor; - } + }; getContent = () => { return formatChildren2(this.editor.children); - } + }; getStringContent = () => { return JSON.stringify(this.getContent()); - } - - applyOperations = (operations) => { - const editor = this.editor; - Editor.withoutNormalizing(editor, () => { - operations.forEach(op => editor.apply(op)); - }); - const ops = editor.operations.slice(); - this.pendingOperationList.push(ops); - editor.operations = []; - } - - getPendingOperationList = () => { - return this.pendingOperationList; - } - - resetPendingOperationList = () => { - const { operations } = this.editor; - this.pendingOperationList = []; - this.pendingOperationList.push(operations); - } - - clearPendingOperationList = () => { - this.pendingOperationList = []; - } + }; } diff --git a/tests/core/utils.js b/tests/core/utils.js index 7b8a9dec..5bcbc463 100644 --- a/tests/core/utils.js +++ b/tests/core/utils.js @@ -6,7 +6,7 @@ export const createSdocEditor = (editor, plugins) => { }); return editor; - + }; export const formatChildren = (node) => {