debian-mirror-gitlab/spec/frontend/vue_shared/components/markdown/toolbar_spec.js
2022-01-26 12:08:38 +05:30

36 lines
891 B
JavaScript

import { mount } from '@vue/test-utils';
import Toolbar from '~/vue_shared/components/markdown/toolbar.vue';
describe('toolbar', () => {
let wrapper;
const createMountedWrapper = (props = {}) => {
wrapper = mount(Toolbar, {
propsData: { markdownDocsPath: '', ...props },
});
};
afterEach(() => {
wrapper.destroy();
});
describe('user can attach file', () => {
beforeEach(() => {
createMountedWrapper();
});
it('should render uploading-container', () => {
expect(wrapper.vm.$el.querySelector('.uploading-container')).not.toBeNull();
});
});
describe('user cannot attach file', () => {
beforeEach(() => {
createMountedWrapper({ canAttachFile: false });
});
it('should not render uploading-container', () => {
expect(wrapper.vm.$el.querySelector('.uploading-container')).toBeNull();
});
});
});