diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 09:55:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 09:55:51 +0000 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /spec/frontend/content_editor/test_utils.js | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) | |
download | gitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/frontend/content_editor/test_utils.js')
-rw-r--r-- | spec/frontend/content_editor/test_utils.js | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/spec/frontend/content_editor/test_utils.js b/spec/frontend/content_editor/test_utils.js index 8e73aef678b..090e1d92218 100644 --- a/spec/frontend/content_editor/test_utils.js +++ b/spec/frontend/content_editor/test_utils.js @@ -3,6 +3,16 @@ import { Document } from '@tiptap/extension-document'; import { Paragraph } from '@tiptap/extension-paragraph'; import { Text } from '@tiptap/extension-text'; import { Editor } from '@tiptap/vue-2'; +import { builders, eq } from 'prosemirror-test-builder'; + +export const createDocBuilder = ({ tiptapEditor, names = {} }) => { + const docBuilders = builders(tiptapEditor.schema, { + p: { nodeType: 'paragraph' }, + ...names, + }); + + return { eq, builders: docBuilders }; +}; /** * Creates an instance of the Tiptap Editor class @@ -15,7 +25,7 @@ import { Editor } from '@tiptap/vue-2'; * include in the editor * @returns An instance of a Tiptap’s Editor class */ -export const createTestEditor = ({ extensions = [] }) => { +export const createTestEditor = ({ extensions = [] } = {}) => { return new Editor({ extensions: [Document, Text, Paragraph, ...extensions], }); |