summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorClement Ho <clemmakesapps@gmail.com>2017-11-21 09:39:57 +0000
committerFilipa Lacerda <filipa@gitlab.com>2017-11-21 09:39:57 +0000
commiteb5333970c0f2247e86dc5b834a231796236e7c2 (patch)
tree2c50462e526357e6e768c70f248165aff0f076c7 /spec
parent3d67018c16756d548b0a891bb118d2ef215355cb (diff)
downloadgitlab-ce-eb5333970c0f2247e86dc5b834a231796236e7c2.tar.gz
Backport ability to enable/disable file attachments in issuable form
Diffstat (limited to 'spec')
-rw-r--r--spec/javascripts/vue_shared/components/markdown/toolbar_spec.js37
1 files changed, 37 insertions, 0 deletions
diff --git a/spec/javascripts/vue_shared/components/markdown/toolbar_spec.js b/spec/javascripts/vue_shared/components/markdown/toolbar_spec.js
new file mode 100644
index 00000000000..818ef0af3c2
--- /dev/null
+++ b/spec/javascripts/vue_shared/components/markdown/toolbar_spec.js
@@ -0,0 +1,37 @@
+import Vue from 'vue';
+import toolbar from '~/vue_shared/components/markdown/toolbar.vue';
+import mountComponent from '../../../helpers/vue_mount_component_helper';
+
+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, Object.assign({}, props, {
+ canAttachFile: false,
+ }));
+ });
+
+ it('should not render uploading-container', () => {
+ expect(vm.$el.querySelector('.uploading-container')).toBeNull();
+ });
+ });
+});