diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-24 18:10:36 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-08-24 18:10:36 +0300 |
commit | 234dc40a12a1cdaef0cdb825ca4acc3f271c6394 (patch) | |
tree | fb9875dca8b558acafa54c36a591b4d2ed10fc49 /spec/frontend/blob_edit | |
parent | c7864d3d50b4002c621c7cba2e1ebfb5d23ac7ed (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.js | 11 |
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, + }); }); }); |