summaryrefslogtreecommitdiff
path: root/spec/frontend/content_editor/components
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-03-25 00:09:18 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-03-25 00:09:18 +0000
commit0a209fd10ef3cb8b68ca3d8e56a99f67bd6998c1 (patch)
treedb3d35d2882336d67017a1c3eef98455de068503 /spec/frontend/content_editor/components
parente0e980334d60fc543b77e2c7652eb06b954e1fa8 (diff)
downloadgitlab-ce-0a209fd10ef3cb8b68ca3d8e56a99f67bd6998c1.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/content_editor/components')
-rw-r--r--spec/frontend/content_editor/components/content_editor_spec.js26
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/frontend/content_editor/components/content_editor_spec.js b/spec/frontend/content_editor/components/content_editor_spec.js
new file mode 100644
index 00000000000..f055a49135b
--- /dev/null
+++ b/spec/frontend/content_editor/components/content_editor_spec.js
@@ -0,0 +1,26 @@
+import { shallowMount } from '@vue/test-utils';
+import { EditorContent } from 'tiptap';
+import ContentEditor from '~/content_editor/components/content_editor.vue';
+import createEditor from '~/content_editor/services/create_editor';
+
+jest.mock('~/content_editor/services/create_editor');
+
+describe('ContentEditor', () => {
+ let wrapper;
+
+ const buildWrapper = () => {
+ wrapper = shallowMount(ContentEditor);
+ };
+
+ afterEach(() => {
+ wrapper.destroy();
+ });
+
+ it('renders editor content component and attaches editor instance', () => {
+ const editor = {};
+
+ createEditor.mockReturnValueOnce(editor);
+ buildWrapper();
+ expect(wrapper.findComponent(EditorContent).props().editor).toBe(editor);
+ });
+});