Commit 0335e0c4 authored by Kushal Pandya's avatar Kushal Pandya

Merge branch 'ph/fixFailingMasterMRWidgetOptions' into 'master'

Fixed failing Jest master

See merge request gitlab-org/gitlab!71386
parents 7a2f033b 47a3318e
......@@ -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