Commit d34e937b authored by Tomasz Maczukin's avatar Tomasz Maczukin

Add tests for frontend changes

parent 1b0b8b9c
...@@ -115,6 +115,10 @@ export default { ...@@ -115,6 +115,10 @@ export default {
commit_path: '/root/ci-mock/commit/c58647773a6b5faf066d4ad6ff2c9fbba5f180f6', commit_path: '/root/ci-mock/commit/c58647773a6b5faf066d4ad6ff2c9fbba5f180f6',
}, },
}, },
timeout: {
value: '1m 40s',
source: 'runner',
},
merge_request: { merge_request: {
iid: 2, iid: 2,
path: '/root/ci-mock/merge_requests/2', path: '/root/ci-mock/merge_requests/2',
......
...@@ -37,4 +37,21 @@ describe('Sidebar detail row', () => { ...@@ -37,4 +37,21 @@ describe('Sidebar detail row', () => {
vm.$el.textContent.replace(/\s+/g, ' ').trim(), vm.$el.textContent.replace(/\s+/g, ' ').trim(),
).toEqual('this is the title: this is the value'); ).toEqual('this is the title: this is the value');
}); });
it('should not render help when helpUrl not provided', () => {
expect(vm.$el.querySelector('.help-button')).toBeUndefined();
});
beforeEach(() => {
vm = new SidebarDetailRow({
propsData: {
helpUrl: 'help url',
},
}).$mount();
});
it('should render help when helpUrl is provided', () => {
expect(vm.$el.querySelector('.help-button a').getAttribute('href')).toEqual('help url');
});
}); });
...@@ -96,6 +96,12 @@ describe('Sidebar details block', () => { ...@@ -96,6 +96,12 @@ describe('Sidebar details block', () => {
).toEqual('Runner: #1'); ).toEqual('Runner: #1');
}); });
it('should render timeout information', () => {
expect(
trimWhitespace(vm.$el.querySelector('.js-job-timeout')),
).toEqual('Timeout: 1m 40s (from runner)');
});
it('should render coverage', () => { it('should render coverage', () => {
expect( expect(
trimWhitespace(vm.$el.querySelector('.js-job-coverage')), trimWhitespace(vm.$el.querySelector('.js-job-coverage')),
......
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