Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-26 18:10:20 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-26 18:10:20 +0300
commitaad3ac9e5e59d47e389ff387e9fc2ae3a008de33 (patch)
tree42ab9daf2c541be5fe58798d7ea0d86b190c2df8 /spec/frontend/content_editor
parente5e0589e097991ca671a348de81331240e85719d (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/content_editor')
-rw-r--r--spec/frontend/content_editor/components/content_editor_spec.js22
-rw-r--r--spec/frontend/content_editor/services/create_editor_spec.js4
2 files changed, 14 insertions, 12 deletions
diff --git a/spec/frontend/content_editor/components/content_editor_spec.js b/spec/frontend/content_editor/components/content_editor_spec.js
index c3c8654ce3d..020a6f4c37d 100644
--- a/spec/frontend/content_editor/components/content_editor_spec.js
+++ b/spec/frontend/content_editor/components/content_editor_spec.js
@@ -1,36 +1,38 @@
-import { shallowMount } from '@vue/test-utils';
+import { mount } from '@vue/test-utils';
import { EditorContent } from 'tiptap';
+import waitForPromises from 'helpers/wait_for_promises';
import ContentEditor from '~/content_editor/components/content_editor.vue';
import TopToolbar from '~/content_editor/components/top_toolbar.vue';
import createEditor from '~/content_editor/services/create_editor';
-import createMarkdownSerializer from '~/content_editor/services/markdown_serializer';
describe('ContentEditor', () => {
let wrapper;
let editor;
- const buildWrapper = async () => {
- editor = await createEditor({ serializer: createMarkdownSerializer({ toHTML: () => '' }) });
- wrapper = shallowMount(ContentEditor, {
+ const createWrapper = async (_editor) => {
+ wrapper = mount(ContentEditor, {
propsData: {
- editor,
+ editor: _editor,
},
});
};
+ beforeEach(async () => {
+ editor = await createEditor({ renderMarkdown: () => 'sample text' });
+ createWrapper(editor);
+
+ await waitForPromises();
+ });
+
afterEach(() => {
wrapper.destroy();
});
it('renders editor content component and attaches editor instance', async () => {
- await buildWrapper();
-
expect(wrapper.findComponent(EditorContent).props().editor).toBe(editor);
});
it('renders top toolbar component and attaches editor instance', async () => {
- await buildWrapper();
-
expect(wrapper.findComponent(TopToolbar).props().editor).toBe(editor);
});
});
diff --git a/spec/frontend/content_editor/services/create_editor_spec.js b/spec/frontend/content_editor/services/create_editor_spec.js
index a6a2327a11f..1f297cb5958 100644
--- a/spec/frontend/content_editor/services/create_editor_spec.js
+++ b/spec/frontend/content_editor/services/create_editor_spec.js
@@ -11,12 +11,12 @@ describe('content_editor/services/create_editor', () => {
deserialize: jest.fn(),
});
- it('sets gl-py-4 gl-px-5 class selectors to editor attributes', async () => {
+ it('sets gl-outline-0! class selector to editor attributes', async () => {
const editor = await createEditor({ renderMarkdown });
expect(editor.options.editorProps).toMatchObject({
attributes: {
- class: 'gl-py-4 gl-px-5',
+ class: 'gl-outline-0!',
},
});
});