gitlab-org--gitlab-foss/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

import { mount } from '@vue/test-utils';
import { GlIcon } from '@gitlab/ui';
2018-06-02 13:45:58 +00:00
import Description from '~/ide/components/jobs/detail/description.vue';
import { jobs } from '../../../mock_data';
describe('IDE job description', () => {
let wrapper;
2018-06-02 13:45:58 +00:00
beforeEach(() => {
wrapper = mount(Description, {
propsData: {
job: jobs[0],
},
2018-06-02 13:45:58 +00:00
});
});
afterEach(() => {
wrapper.destroy();
2018-06-02 13:45:58 +00:00
});
it('renders job details', () => {
expect(wrapper.text()).toContain('#1');
expect(wrapper.text()).toContain('test');
2018-06-02 13:45:58 +00:00
});
it('renders CI icon', () => {
expect(wrapper.find('.ci-status-icon').findComponent(GlIcon).exists()).toBe(true);
2018-06-02 13:45:58 +00:00
});
it('renders a borderless CI icon', () => {
expect(wrapper.find('.borderless').findComponent(GlIcon).exists()).toBe(true);
});
it('renders bridge job details without the job link', () => {
wrapper = mount(Description, {
propsData: {
job: { ...jobs[0], path: undefined },
},
});
expect(wrapper.find('[data-testid="description-detail-link"]').exists()).toBe(false);
});
2018-06-02 13:45:58 +00:00
});