Commit a22bc313 authored by Fernando's avatar Fernando

Fix unit test and vue component

* Import GlButton and update unit tests
parent 52755244
<script>
import statusIcon from '~/vue_merge_request_widget/components/mr_widget_status_icon.vue';
import { GlButton } from '@gitlab/ui';
import StatusIcon from '~/vue_merge_request_widget/components/mr_widget_status_icon.vue';
export default {
name: 'MRWidgetPolicyViolation',
components: {
statusIcon,
GlButton,
StatusIcon,
},
};
</script>
......
import { shallowMount } from '@vue/test-utils';
import { GlButton } from '@gitlab/ui';
import MrWidgetPolicyViolation from 'ee/vue_merge_request_widget/components/states/mr_widget_policy_violation.vue';
describe('EE MrWidgetPolicyViolation', () => {
let wrapper;
const findButton = () => wrapper.find('button');
const findButton = () => wrapper.find(GlButton);
const createComponent = () => {
wrapper = shallowMount(MrWidgetPolicyViolation, {});
......@@ -21,7 +22,7 @@ describe('EE MrWidgetPolicyViolation', () => {
it('shows the disabled merge button', () => {
expect(wrapper.text()).toContain('Merge');
expect(findButton().attributes().disabled).toBe('disabled');
expect(findButton().attributes().disabled).toBe('true');
});
it('shows the disabled reason', () => {
......
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