diff options
Diffstat (limited to 'spec/frontend/vue_shared/components/markdown/toolbar_spec.js')
-rw-r--r-- | spec/frontend/vue_shared/components/markdown/toolbar_spec.js | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/spec/frontend/vue_shared/components/markdown/toolbar_spec.js b/spec/frontend/vue_shared/components/markdown/toolbar_spec.js new file mode 100644 index 00000000000..e7c31014bfc --- /dev/null +++ b/spec/frontend/vue_shared/components/markdown/toolbar_spec.js @@ -0,0 +1,35 @@ +import Vue from 'vue'; +import mountComponent from 'helpers/vue_mount_component_helper'; +import toolbar from '~/vue_shared/components/markdown/toolbar.vue'; + +describe('toolbar', () => { + let vm; + const Toolbar = Vue.extend(toolbar); + const props = { + markdownDocsPath: '', + }; + + afterEach(() => { + vm.$destroy(); + }); + + describe('user can attach file', () => { + beforeEach(() => { + vm = mountComponent(Toolbar, props); + }); + + it('should render uploading-container', () => { + expect(vm.$el.querySelector('.uploading-container')).not.toBeNull(); + }); + }); + + describe('user cannot attach file', () => { + beforeEach(() => { + vm = mountComponent(Toolbar, { ...props, canAttachFile: false }); + }); + + it('should not render uploading-container', () => { + expect(vm.$el.querySelector('.uploading-container')).toBeNull(); + }); + }); +}); |