karma fixes

This commit is contained in:
Phil Hughes 2018-05-29 14:26:46 +01:00
parent 66bf2de830
commit aab713132e
No known key found for this signature in database
GPG key ID: 32245528C52E0F9F
2 changed files with 6 additions and 4 deletions

View file

@ -38,7 +38,7 @@ describe('IDE pipelines list', () => {
mock
.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();
@ -48,6 +48,8 @@ describe('IDE pipelines list', () => {
afterEach(() => {
vm.$destroy();
mock.restore();
vm.$store.dispatch('stopPipelinePolling');
vm.$store.dispatch('clearEtagPoll');
});
it('renders pipeline data', () => {

View file

@ -43,15 +43,15 @@ describe('Tabs component', () => {
});
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 => {
vm.$el.querySelectorAll('a')[1].click();
setTimeout(() => {
expect(vm.$el.querySelector('li').classList).not.toContain('active');
expect(vm.$el.querySelectorAll('li')[1].classList).toContain('active');
expect(vm.$el.querySelector('a').classList).not.toContain('active');
expect(vm.$el.querySelectorAll('a')[1].classList).toContain('active');
done();
});