debian-mirror-gitlab/spec/javascripts/vue_shared/components/markdown/toolbar_spec.js

41 lines
950 B
JavaScript
Raw Normal View History

2018-03-17 18:26:18 +05:30
import Vue from 'vue';
import toolbar from '~/vue_shared/components/markdown/toolbar.vue';
2018-05-09 12:01:36 +05:30
import mountComponent from 'spec/helpers/vue_mount_component_helper';
2018-03-17 18:26:18 +05:30
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(() => {
2018-12-13 13:39:08 +05:30
vm = mountComponent(
Toolbar,
Object.assign({}, props, {
canAttachFile: false,
}),
);
2018-03-17 18:26:18 +05:30
});
it('should not render uploading-container', () => {
expect(vm.$el.querySelector('.uploading-container')).toBeNull();
});
});
});