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 { shallowMount, mount } from '@vue/test-utils';
import mountComponent from 'helpers/vue_mount_component_helper'; import PipelineBlockedComponent from '~/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.vue';
import { removeBreakLine } from 'helpers/text_helper';
import pipelineBlockedComponent from '~/vue_merge_request_widget/components/states/mr_widget_pipeline_blocked.vue';
describe('MRWidgetPipelineBlocked', () => { describe('MRWidgetPipelineBlocked', () => {
let vm; let wrapper;
beforeEach(() => {
const Component = Vue.extend(pipelineBlockedComponent); const createWrapper = (mountFn = shallowMount) => {
vm = mountComponent(Component); wrapper = mountFn(PipelineBlockedComponent);
}); };
afterEach(() => { afterEach(() => {
vm.$destroy(); wrapper.destroy();
}); });
it('renders warning icon', () => { 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', () => { 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', '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