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