2017-05-06 17:02:06 +00:00
|
|
|
import Vue from 'vue';
|
|
|
|
import dropdownActionComponent from '~/pipelines/components/graph/dropdown_action_component.vue';
|
|
|
|
|
|
|
|
describe('action component', () => {
|
|
|
|
let component;
|
|
|
|
|
2017-05-24 11:42:23 +00:00
|
|
|
beforeEach((done) => {
|
2017-05-06 17:02:06 +00:00
|
|
|
const DropdownActionComponent = Vue.extend(dropdownActionComponent);
|
|
|
|
component = new DropdownActionComponent({
|
|
|
|
propsData: {
|
|
|
|
tooltipText: 'bar',
|
|
|
|
link: 'foo',
|
|
|
|
actionMethod: 'post',
|
2017-10-09 12:16:21 +00:00
|
|
|
actionIcon: 'cancel',
|
2017-05-06 17:02:06 +00:00
|
|
|
},
|
|
|
|
}).$mount();
|
2017-05-24 11:42:23 +00:00
|
|
|
|
|
|
|
Vue.nextTick(done);
|
2017-05-06 17:02:06 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
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();
|
|
|
|
});
|
|
|
|
});
|