debian-mirror-gitlab/spec/frontend/ide/components/jobs/detail/description_spec.js

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
1.1 KiB
JavaScript
Raw Normal View History

2022-11-25 23:54:43 +05:30
import { mount } from '@vue/test-utils';
import { GlIcon } from '@gitlab/ui';
2018-11-08 19:23:39 +05:30
import Description from '~/ide/components/jobs/detail/description.vue';
import { jobs } from '../../../mock_data';
describe('IDE job description', () => {
2022-11-25 23:54:43 +05:30
let wrapper;
2018-11-08 19:23:39 +05:30
beforeEach(() => {
2022-11-25 23:54:43 +05:30
wrapper = mount(Description, {
propsData: {
job: jobs[0],
},
2018-11-08 19:23:39 +05:30
});
});
afterEach(() => {
2022-11-25 23:54:43 +05:30
wrapper.destroy();
2018-11-08 19:23:39 +05:30
});
it('renders job details', () => {
2022-11-25 23:54:43 +05:30
expect(wrapper.text()).toContain('#1');
expect(wrapper.text()).toContain('test');
2018-11-08 19:23:39 +05:30
});
it('renders CI icon', () => {
2022-11-25 23:54:43 +05:30
expect(wrapper.find('.ci-status-icon').findComponent(GlIcon).exists()).toBe(true);
2020-11-24 15:15:51 +05:30
});
2022-07-23 23:45:48 +05:30
it('renders a borderless CI icon', () => {
2022-11-25 23:54:43 +05:30
expect(wrapper.find('.borderless').findComponent(GlIcon).exists()).toBe(true);
2022-07-23 23:45:48 +05:30
});
2020-11-24 15:15:51 +05:30
it('renders bridge job details without the job link', () => {
2022-11-25 23:54:43 +05:30
wrapper = mount(Description, {
propsData: {
job: { ...jobs[0], path: undefined },
},
2020-11-24 15:15:51 +05:30
});
2022-11-25 23:54:43 +05:30
expect(wrapper.find('[data-testid="description-detail-link"]').exists()).toBe(false);
2018-11-08 19:23:39 +05:30
});
});