Commit a2e9af71 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch '220476-convert-mr_widget_pipeline_blocked_spec-spec' into 'master'

Update pipeline blocked component specs to VTU

See merge request gitlab-org/gitlab!52682
parents c279c795 dd7fd3ae
import Vue from 'vue';
import mountComponent from 'helpers/vue_mount_component_helper';
import { removeBreakLine } from 'helpers/text_helper';
import pipelineBlockedComponent from '~/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.vue';
import { shallowMount, mount } from '@vue/test-utils';
import PipelineBlockedComponent from '~/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.vue';
describe('MRWidgetPipelineBlocked', () => {
let vm;
beforeEach(() => {
const Component = Vue.extend(pipelineBlockedComponent);
vm = mountComponent(Component);
});
let wrapper;
const createWrapper = (mountFn = shallowMount) => {
wrapper = mountFn(PipelineBlockedComponent);
};
afterEach(() => {
vm.$destroy();
wrapper.destroy();
});
it('renders warning icon', () => {
expect(vm.$el.querySelector('.ci-status-icon-warning')).not.toBe(null);
createWrapper(mount);
expect(wrapper.find('.ci-status-icon-warning').exists()).toBe(true);
});
it('renders information text', () => {
expect(removeBreakLine(vm.$el.textContent).trim()).toContain(
createWrapper();
expect(wrapper.text()).toBe(
'Pipeline blocked. The pipeline for this merge request requires a manual action to proceed',
);
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment