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-08-24 18:10:36 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-24 18:10:36 +0300
commit234dc40a12a1cdaef0cdb825ca4acc3f271c6394 (patch)
treefb9875dca8b558acafa54c36a591b4d2ed10fc49 /spec/frontend/blob_edit
parentc7864d3d50b4002c621c7cba2e1ebfb5d23ac7ed (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/frontend/blob_edit')
-rw-r--r--spec/frontend/blob_edit/edit_blob_spec.js11
1 files changed, 9 insertions, 2 deletions
diff --git a/spec/frontend/blob_edit/edit_blob_spec.js b/spec/frontend/blob_edit/edit_blob_spec.js
index 2be72ded0a2..ebef0656750 100644
--- a/spec/frontend/blob_edit/edit_blob_spec.js
+++ b/spec/frontend/blob_edit/edit_blob_spec.js
@@ -8,6 +8,8 @@ jest.mock('~/editor/source_editor');
jest.mock('~/editor/extensions/source_editor_markdown_ext');
jest.mock('~/editor/extensions/source_editor_file_template_ext');
+const PREVIEW_MARKDOWN_PATH = '/foo/bar/preview_markdown';
+
describe('Blob Editing', () => {
const useMock = jest.fn();
const mockInstance = {
@@ -34,6 +36,7 @@ describe('Blob Editing', () => {
const editorInst = (isMarkdown) => {
return new EditBlob({
isMarkdown,
+ previewMarkdownPath: PREVIEW_MARKDOWN_PATH,
});
};
@@ -44,6 +47,7 @@ describe('Blob Editing', () => {
it('loads FileTemplateExtension by default', async () => {
await initEditor();
+ expect(useMock).toHaveBeenCalledWith(expect.any(FileTemplateExtension));
expect(FileTemplateExtension).toHaveBeenCalledTimes(1);
});
@@ -55,9 +59,12 @@ describe('Blob Editing', () => {
it('loads MarkdownExtension only for the markdown files', async () => {
await initEditor(true);
- expect(useMock).toHaveBeenCalledTimes(2);
- expect(FileTemplateExtension).toHaveBeenCalledTimes(1);
+ expect(useMock).toHaveBeenCalledWith(expect.any(EditorMarkdownExtension));
expect(EditorMarkdownExtension).toHaveBeenCalledTimes(1);
+ expect(EditorMarkdownExtension).toHaveBeenCalledWith({
+ instance: mockInstance,
+ previewMarkdownPath: PREVIEW_MARKDOWN_PATH,
+ });
});
});