diff options
Diffstat (limited to 'spec/frontend/pipelines/graph/job_name_component_spec.js')
-rw-r--r-- | spec/frontend/pipelines/graph/job_name_component_spec.js | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/spec/frontend/pipelines/graph/job_name_component_spec.js b/spec/frontend/pipelines/graph/job_name_component_spec.js new file mode 100644 index 00000000000..3574b66403e --- /dev/null +++ b/spec/frontend/pipelines/graph/job_name_component_spec.js @@ -0,0 +1,36 @@ +import { mount } from '@vue/test-utils'; +import ciIcon from '~/vue_shared/components/ci_icon.vue'; + +import jobNameComponent from '~/pipelines/components/graph/job_name_component.vue'; + +describe('job name component', () => { + let wrapper; + + const propsData = { + name: 'foo', + status: { + icon: 'status_success', + group: 'success', + }, + }; + + beforeEach(() => { + wrapper = mount(jobNameComponent, { + propsData, + }); + }); + + it('should render the provided name', () => { + expect( + wrapper + .find('.ci-status-text') + .text() + .trim(), + ).toBe(propsData.name); + }); + + it('should render an icon with the provided status', () => { + expect(wrapper.find(ciIcon).exists()).toBe(true); + expect(wrapper.find('.ci-status-icon-success').exists()).toBe(true); + }); +}); |