diff options
Diffstat (limited to 'spec/frontend/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal_spec.js')
-rw-r--r-- | spec/frontend/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal_spec.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/spec/frontend/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal_spec.js b/spec/frontend/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal_spec.js index 6e2bf21b692..0c2ac53aa52 100644 --- a/spec/frontend/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal_spec.js +++ b/spec/frontend/vue_shared/components/rich_content_editor/modals/add_image/add_image_modal_spec.js @@ -6,6 +6,7 @@ import { IMAGE_TABS } from '~/vue_shared/components/rich_content_editor/constant describe('Add Image Modal', () => { let wrapper; + const propsData = { imageRoot: 'path/to/root/' }; const findModal = () => wrapper.find(GlModal); const findTabs = () => wrapper.find(GlTabs); @@ -14,7 +15,10 @@ describe('Add Image Modal', () => { const findDescriptionInput = () => wrapper.find({ ref: 'descriptionInput' }); beforeEach(() => { - wrapper = shallowMount(AddImageModal, { provide: { glFeatures: { sseImageUploads: true } } }); + wrapper = shallowMount(AddImageModal, { + provide: { glFeatures: { sseImageUploads: true } }, + propsData, + }); }); describe('when content is loaded', () => { @@ -44,9 +48,10 @@ describe('Add Image Modal', () => { it('validates the file', () => { const preventDefault = jest.fn(); const description = 'some description'; + const file = { name: 'some_file.png' }; wrapper.vm.$refs.uploadImageTab = { validateFile: jest.fn() }; - wrapper.setData({ description, tabIndex: IMAGE_TABS.UPLOAD_TAB }); + wrapper.setData({ file, description, tabIndex: IMAGE_TABS.UPLOAD_TAB }); findModal().vm.$emit('ok', { preventDefault }); |