diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-17 17:16:34 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-17 17:16:34 +0300 |
commit | 4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e (patch) | |
tree | 2b256ff8dfe63dafe7f42b0d995f9e74fd1dc48b /spec/javascripts | |
parent | bd860c22f6a4b9473cbddd34a53eead8235a7ea1 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/javascripts')
-rw-r--r-- | spec/javascripts/jobs/components/log/duration_badge_spec.js | 31 | ||||
-rw-r--r-- | spec/javascripts/jobs/components/log/line_header_spec.js | 11 |
2 files changed, 42 insertions, 0 deletions
diff --git a/spec/javascripts/jobs/components/log/duration_badge_spec.js b/spec/javascripts/jobs/components/log/duration_badge_spec.js new file mode 100644 index 00000000000..2ac34e78909 --- /dev/null +++ b/spec/javascripts/jobs/components/log/duration_badge_spec.js @@ -0,0 +1,31 @@ +import { shallowMount } from '@vue/test-utils'; +import DurationBadge from '~/jobs/components/log/duration_badge.vue'; + +describe('Job Log Duration Badge', () => { + let wrapper; + + const data = { + duration: '00:30:01', + }; + + const createComponent = (props = {}) => { + wrapper = shallowMount(DurationBadge, { + sync: false, + propsData: { + ...props, + }, + }); + }; + + beforeEach(() => { + createComponent(data); + }); + + afterEach(() => { + wrapper.destroy(); + }); + + it('renders provided duration', () => { + expect(wrapper.text()).toBe(data.duration); + }); +}); diff --git a/spec/javascripts/jobs/components/log/line_header_spec.js b/spec/javascripts/jobs/components/log/line_header_spec.js index 4efd412a6cd..2d2f92fad9d 100644 --- a/spec/javascripts/jobs/components/log/line_header_spec.js +++ b/spec/javascripts/jobs/components/log/line_header_spec.js @@ -1,6 +1,7 @@ import { mount } from '@vue/test-utils'; import LineHeader from '~/jobs/components/log/line_header.vue'; import LineNumber from '~/jobs/components/log/line_number.vue'; +import DurationBadge from '~/jobs/components/log/duration_badge.vue'; describe('Job Log Header Line', () => { let wrapper; @@ -81,4 +82,14 @@ describe('Job Log Header Line', () => { expect(wrapper.emitted().toggleLine.length).toBe(1); }); }); + + describe('with duration', () => { + beforeEach(() => { + createComponent(Object.assign({}, data, { duration: '00:10' })); + }); + + it('renders the duration badge', () => { + expect(wrapper.contains(DurationBadge)).toBe(true); + }); + }); }); |