summaryrefslogtreecommitdiff
path: root/spec/javascripts/pipelines/graph/job_name_component_spec.js
blob: c861d452dd0a897168bada9699c7e8a5428a0c4c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import Vue from 'vue';
import jobNameComponent from '~/pipelines/components/graph/job_name_component.vue';

describe('job name component', () => {
  let component;

  beforeEach(() => {
    const JobNameComponent = Vue.extend(jobNameComponent);
    component = new JobNameComponent({
      propsData: {
        name: 'foo',
        status: {
          icon: 'status_success',
        },
      },
    }).$mount();
  });

  it('should render the provided name', () => {
    expect(component.$el.querySelector('.ci-status-text').textContent.trim()).toEqual('foo');
  });

  it('should render an icon with the provided status', () => {
    expect(component.$el.querySelector('.ci-status-icon-success')).toBeDefined();
    expect(component.$el.querySelector('.ci-status-icon-success svg')).toBeDefined();
  });
});