Commit a22bc313 authored by Fernando's avatar Fernando

Fix unit test and vue component

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