Commit 47a3318e authored by Phil Hughes's avatar Phil Hughes

Fixed failing Jest master

This was caused by 2 different merge requests being merged
at the same time.
1 included new icons and the other was to add tests.
parent 920bd863
......@@ -46,6 +46,8 @@ export default {
return true;
},
statusIconName() {
if (this.isLoadingSummary) return null;
return this.statusIcon(this.collapsedData);
},
},
......
......@@ -19,7 +19,8 @@ export default {
},
iconName: {
type: String,
required: true,
required: false,
default: null,
},
},
computed: {
......
......@@ -10,7 +10,10 @@ import axios from '~/lib/utils/axios_utils';
import { setFaviconOverlay } from '~/lib/utils/favicon';
import notify from '~/lib/utils/notify';
import SmartInterval from '~/smart_interval';
import { registerExtension } from '~/vue_merge_request_widget/components/extensions';
import {
registerExtension,
registeredExtensions,
} from '~/vue_merge_request_widget/components/extensions';
import { SUCCESS } from '~/vue_merge_request_widget/components/deployment/constants';
import eventHub from '~/vue_merge_request_widget/event_hub';
import MrWidgetOptions from '~/vue_merge_request_widget/mr_widget_options.vue';
......@@ -886,20 +889,22 @@ describe('MrWidgetOptions', () => {
describe('mock extension', () => {
beforeEach(() => {
registerExtension(testExtension);
createComponent();
});
it('renders collapsed data', async () => {
registerExtension(testExtension);
afterEach(() => {
registeredExtensions.extensions = [];
});
it('renders collapsed data', async () => {
await waitForPromises();
expect(wrapper.text()).toContain('Test extension summary count: 1');
});
it('renders full data', async () => {
registerExtension(testExtension);
await waitForPromises();
wrapper
......
import { EXTENSION_ICONS } from '~/vue_merge_request_widget/constants';
export default {
name: 'WidgetTestExtension',
props: ['targetProjectFullPath'],
......@@ -6,7 +8,7 @@ export default {
return `Test extension summary count: ${count} & ${targetProjectFullPath}`;
},
statusIcon({ count }) {
return count > 0 ? 'warning' : 'success';
return count > 0 ? EXTENSION_ICONS.warning : EXTENSION_ICONS.success;
},
},
methods: {
......
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