Commit a9470c45 authored by Phil Hughes's avatar Phil Hughes

fixed karma failures

[ci skip]
parent b2c27518
......@@ -25,7 +25,7 @@ describe('Title component', () => {
it('renders title HTML', () => {
expect(
vm.$el.querySelector('h2').innerHTML.trim(),
vm.$el.innerHTML.trim(),
).toBe('Testing <img>');
});
......@@ -47,12 +47,12 @@ describe('Title component', () => {
Vue.nextTick(() => {
expect(
vm.$el.querySelector('h2').classList.contains('issue-realtime-pre-pulse'),
vm.$el.classList.contains('issue-realtime-pre-pulse'),
).toBeTruthy();
setTimeout(() => {
expect(
vm.$el.querySelector('h2').classList.contains('issue-realtime-trigger-pulse'),
vm.$el.classList.contains('issue-realtime-trigger-pulse'),
).toBeTruthy();
done();
......
......@@ -4,7 +4,7 @@ import actionComponent from '~/pipelines/components/graph/action_component.vue';
describe('pipeline graph action component', () => {
let component;
beforeEach(() => {
beforeEach((done) => {
const ActionComponent = Vue.extend(actionComponent);
component = new ActionComponent({
propsData: {
......@@ -14,6 +14,8 @@ describe('pipeline graph action component', () => {
actionIcon: 'icon_action_cancel',
},
}).$mount();
Vue.nextTick(done);
});
it('should render a link', () => {
......@@ -27,7 +29,7 @@ describe('pipeline graph action component', () => {
it('should update bootstrap tooltip when title changes', (done) => {
component.tooltipText = 'changed';
Vue.nextTick(() => {
setTimeout(() => {
expect(component.$el.getAttribute('data-original-title')).toBe('changed');
done();
});
......
......@@ -4,7 +4,7 @@ import dropdownActionComponent from '~/pipelines/components/graph/dropdown_actio
describe('action component', () => {
let component;
beforeEach(() => {
beforeEach((done) => {
const DropdownActionComponent = Vue.extend(dropdownActionComponent);
component = new DropdownActionComponent({
propsData: {
......@@ -14,6 +14,8 @@ describe('action component', () => {
actionIcon: 'icon_action_cancel',
},
}).$mount();
Vue.nextTick(done);
});
it('should render a link', () => {
......
......@@ -27,13 +27,14 @@ describe('pipeline graph job component', () => {
});
describe('name with link', () => {
it('should render the job name and status with a link', () => {
it('should render the job name and status with a link', (done) => {
const component = new JobComponent({
propsData: {
job: mockJob,
},
}).$mount();
Vue.nextTick(() => {
const link = component.$el.querySelector('a');
expect(link.getAttribute('href')).toEqual(mockJob.status.details_path);
......@@ -47,6 +48,9 @@ describe('pipeline graph job component', () => {
expect(
component.$el.querySelector('.ci-status-text').textContent.trim(),
).toEqual(mockJob.name);
done();
});
});
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment