Commit aab71313 authored by Phil Hughes's avatar Phil Hughes

karma fixes

parent 66bf2de8
...@@ -38,7 +38,7 @@ describe('IDE pipelines list', () => { ...@@ -38,7 +38,7 @@ describe('IDE pipelines list', () => {
mock mock
.onGet('/abc/def/commit/123/pipelines') .onGet('/abc/def/commit/123/pipelines')
.reply(200, { pipelines: [...pipelines] }, { 'poll-interval': '-1' }); .replyOnce(200, { pipelines: [...pipelines] }, { 'poll-interval': '-1' });
vm = createComponentWithStore(Component, store).$mount(); vm = createComponentWithStore(Component, store).$mount();
...@@ -48,6 +48,8 @@ describe('IDE pipelines list', () => { ...@@ -48,6 +48,8 @@ describe('IDE pipelines list', () => {
afterEach(() => { afterEach(() => {
vm.$destroy(); vm.$destroy();
mock.restore(); mock.restore();
vm.$store.dispatch('stopPipelinePolling');
vm.$store.dispatch('clearEtagPoll');
}); });
it('renders pipeline data', () => { it('renders pipeline data', () => {
......
...@@ -43,15 +43,15 @@ describe('Tabs component', () => { ...@@ -43,15 +43,15 @@ describe('Tabs component', () => {
}); });
it('renders active class', () => { it('renders active class', () => {
expect(vm.$el.querySelector('li').classList).toContain('active'); expect(vm.$el.querySelector('a').classList).toContain('active');
}); });
it('updates active class on click', done => { it('updates active class on click', done => {
vm.$el.querySelectorAll('a')[1].click(); vm.$el.querySelectorAll('a')[1].click();
setTimeout(() => { setTimeout(() => {
expect(vm.$el.querySelector('li').classList).not.toContain('active'); expect(vm.$el.querySelector('a').classList).not.toContain('active');
expect(vm.$el.querySelectorAll('li')[1].classList).toContain('active'); expect(vm.$el.querySelectorAll('a')[1].classList).toContain('active');
done(); 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