debian-mirror-gitlab/spec/javascripts/pipelines/graph/dropdown_action_component_spec.js

33 lines
880 B
JavaScript
Raw Normal View History

2017-08-17 22:00:37 +05:30
import Vue from 'vue';
import dropdownActionComponent from '~/pipelines/components/graph/dropdown_action_component.vue';
describe('action component', () => {
let component;
2017-09-10 17:25:29 +05:30
beforeEach((done) => {
2017-08-17 22:00:37 +05:30
const DropdownActionComponent = Vue.extend(dropdownActionComponent);
component = new DropdownActionComponent({
propsData: {
tooltipText: 'bar',
link: 'foo',
actionMethod: 'post',
2018-03-17 18:26:18 +05:30
actionIcon: 'cancel',
2017-08-17 22:00:37 +05:30
},
}).$mount();
2017-09-10 17:25:29 +05:30
Vue.nextTick(done);
2017-08-17 22:00:37 +05:30
});
it('should render a link', () => {
expect(component.$el.getAttribute('href')).toEqual('foo');
});
it('should render the provided title as a bootstrap tooltip', () => {
expect(component.$el.getAttribute('data-original-title')).toEqual('bar');
});
it('should render an svg', () => {
expect(component.$el.querySelector('svg')).toBeDefined();
});
});