Commit 2b4db15b authored by Brandon Labuschagne's avatar Brandon Labuschagne

Merge branch '232503-editor-lite-to-snippet' into 'master'

Snippet Edit: replaced blob-content-edit with editor-lite component

See merge request gitlab-org/gitlab!44994
parents 155eba0e 774cee04
<script>
import { GlLoadingIcon } from '@gitlab/ui';
import BlobHeaderEdit from '~/blob/components/blob_edit_header.vue';
import BlobContentEdit from '~/blob/components/blob_edit_content.vue';
import EditorLite from '~/vue_shared/components/editor_lite.vue';
import { getBaseURL, joinPaths } from '~/lib/utils/url_utility';
import axios from '~/lib/utils/axios_utils';
import { SNIPPET_BLOB_CONTENT_FETCH_ERROR } from '~/snippets/constants';
......@@ -11,8 +11,8 @@ import { sprintf } from '~/locale';
export default {
components: {
BlobHeaderEdit,
BlobContentEdit,
GlLoadingIcon,
EditorLite,
},
inheritAttrs: false,
props: {
......@@ -85,7 +85,7 @@ export default {
size="lg"
class="loading-animation prepend-top-20 gl-mb-6"
/>
<blob-content-edit
<editor-lite
v-else
:value="blob.content"
:file-global-id="blob.id"
......
---
title: Replaced blob-content-edit with editor-lite compoennt for Snippet edit form
merge_request: 44994
author:
type: changed
......@@ -13,7 +13,8 @@ exports[`Snippet Blob Edit component with loaded blob matches snapshot 1`] = `
value="foo/bar/test.md"
/>
<blob-content-edit-stub
<editor-lite-stub
editoroptions="[object Object]"
fileglobalid="blob_local_7"
filename="foo/bar/test.md"
value="Lorem ipsum dolar sit amet,
......
......@@ -5,7 +5,7 @@ import waitForPromises from 'helpers/wait_for_promises';
import { TEST_HOST } from 'helpers/test_constants';
import SnippetBlobEdit from '~/snippets/components/snippet_blob_edit.vue';
import BlobHeaderEdit from '~/blob/components/blob_edit_header.vue';
import BlobContentEdit from '~/blob/components/blob_edit_content.vue';
import EditorLite from '~/vue_shared/components/editor_lite.vue';
import axios from '~/lib/utils/axios_utils';
import { joinPaths } from '~/lib/utils/url_utility';
import { deprecatedCreateFlash as createFlash } from '~/flash';
......@@ -48,7 +48,7 @@ describe('Snippet Blob Edit component', () => {
const findLoadingIcon = () => wrapper.find(GlLoadingIcon);
const findHeader = () => wrapper.find(BlobHeaderEdit);
const findContent = () => wrapper.find(BlobContentEdit);
const findContent = () => wrapper.find(EditorLite);
const getLastUpdatedArgs = () => {
const event = wrapper.emitted()['blob-updated'];
......@@ -172,11 +172,13 @@ describe('Snippet Blob Edit component', () => {
expect(findContent().exists()).toBe(showContent);
if (showContent) {
expect(findContent().props()).toEqual({
value: TEST_BLOB_LOADED.content,
fileGlobalId: TEST_BLOB_LOADED.id,
fileName: TEST_BLOB_LOADED.path,
});
expect(findContent().props()).toEqual(
expect.objectContaining({
value: TEST_BLOB_LOADED.content,
fileGlobalId: TEST_BLOB_LOADED.id,
fileName: TEST_BLOB_LOADED.path,
}),
);
}
});
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment