Commit 60e014c0 authored by Fernando's avatar Fernando

Clean up unit tests

* Clean up descriptions
parent 3d5d9c19
...@@ -3,7 +3,6 @@ import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin'; ...@@ -3,7 +3,6 @@ import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { mapState, mapGetters, mapActions } from 'vuex'; import { mapState, mapGetters, mapActions } from 'vuex';
import { GlButton, GlLoadingIcon, GlIcon, GlPopover } from '@gitlab/ui'; import { GlButton, GlLoadingIcon, GlIcon, GlPopover } from '@gitlab/ui';
import { s__ } from '~/locale'; import { s__ } from '~/locale';
import glFeatureFlagsMixin from '~/vue_shared/mixins/gl_feature_flags_mixin';
import { LICENSE_MANAGEMENT } from 'ee/vue_shared/license_compliance/store/constants'; import { LICENSE_MANAGEMENT } from 'ee/vue_shared/license_compliance/store/constants';
import AddLicenseForm from './components/add_license_form.vue'; import AddLicenseForm from './components/add_license_form.vue';
import AdminLicenseManagementRow from './components/admin_license_management_row.vue'; import AdminLicenseManagementRow from './components/admin_license_management_row.vue';
...@@ -126,7 +125,7 @@ export default { ...@@ -126,7 +125,7 @@ export default {
<span class="text-secondary"> <span class="text-secondary">
{{ s__('Licenses|Acceptable license to be used in the project') }}</span {{ s__('Licenses|Acceptable license to be used in the project') }}</span
> >
<h5>{{ __('Denied') }}</h5> <div class="h5">{{ __('Denied') }}</div>
<span class="text-secondary"> <span class="text-secondary">
{{ {{
s__( s__(
......
...@@ -197,32 +197,23 @@ describe('License Management', () => { ...@@ -197,32 +197,23 @@ describe('License Management', () => {
}); });
}); });
describe('when licenseComplianceDeniesMr feature flag enabled', () => { describe.each([true, false])(
it('should not show the developer only tooltip', () => { 'when licenseComplianceDeniesMr feature flag is %p',
createComponent({ ({ licenseComplianceDeniesMr }) => {
state: { isLoadingManagedLicenses: false }, it('should not show the developer only tooltip', () => {
isAdmin: true, createComponent({
provide: { state: { isLoadingManagedLicenses: false },
glFeatures: { licenseComplianceDeniesMr: true }, isAdmin: false,
}, provide: {
}); glFeatures: { licenseComplianceDeniesMr },
},
expect(findIcon().exists()).toBe(false); });
expect(findPopover().exists()).toBe(false);
});
});
describe('when licenseComplianceDeniesMr feature flag disabled', () => { expect(findIcon().exists()).toBe(false);
it('should not show the developer only tooltip', () => { expect(findPopover().exists()).toBe(false);
createComponent({
state: { isLoadingManagedLicenses: false },
isAdmin: true,
}); });
},
expect(findIcon().exists()).toBe(false); );
expect(findPopover().exists()).toBe(false);
});
});
}); });
describe('when developer', () => { describe('when developer', () => {
...@@ -262,10 +253,14 @@ describe('License Management', () => { ...@@ -262,10 +253,14 @@ describe('License Management', () => {
}); });
}); });
describe.each([true, false])( describe.each`
'when licenseComplianceDeniesMr feature flag is %p', licenseComplianceDeniesMr | should
licenseComplianceDeniesMr => { ${true} | ${'should'}
it('should show the developer only tooltip', () => { ${false} | ${'shouls not'}
`(
'when licenseComplianceDeniesMr feature flag is $licenseComplianceDeniesMr',
({ licenseComplianceDeniesMr, should }) => {
it(`${should} show the developer only tooltip`, () => {
createComponent({ createComponent({
state: { isLoadingManagedLicenses: false }, state: { isLoadingManagedLicenses: false },
isAdmin: false, isAdmin: false,
......
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