Add js test for pipelines component with error badge
This commit is contained in:
parent
663f3240a9
commit
08cc88f9ce
1 changed files with 18 additions and 0 deletions
|
@ -125,4 +125,22 @@ describe('Pipeline Url Component', () => {
|
|||
component.$el.querySelector('.js-pipeline-url-autodevops').textContent.trim(),
|
||||
).toEqual('Auto DevOps');
|
||||
});
|
||||
|
||||
it('should render error badge when pipeline has a failure reason set', () => {
|
||||
const component = new PipelineUrlComponent({
|
||||
propsData: {
|
||||
pipeline: {
|
||||
id: 1,
|
||||
path: 'foo',
|
||||
flags: {
|
||||
failure_reason: true,
|
||||
},
|
||||
failure_reason: 'some reason'
|
||||
},
|
||||
},
|
||||
}).$mount();
|
||||
|
||||
expect(component.$el.querySelector('.js-pipeline-url-failure').textContent).toContain('error');
|
||||
expect(component.$el.querySelector('.js-pipeline-url-failure').getAttribute('title').toContain('some reason');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue