Commit abc8f2b1 authored by Andrew Fontaine's avatar Andrew Fontaine

Merge branch '323206-counter-badge-alignment' into 'master'

Fix: counter badges are misaligned in License Compliance tabs

See merge request gitlab-org/gitlab!55517
parents 703e2c32 e471df7f
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
<gl-tab data-testid="licensesTab"> <gl-tab data-testid="licensesTab">
<template #title> <template #title>
<span data-testid="licensesTabTitle">{{ s__('Licenses|Detected in Project') }}</span> <span data-testid="licensesTabTitle">{{ s__('Licenses|Detected in Project') }}</span>
<gl-badge>{{ licenseCount }}</gl-badge> <gl-badge size="sm" class="gl-tab-counter-badge">{{ licenseCount }}</gl-badge>
</template> </template>
<detected-licenses-table /> <detected-licenses-table />
...@@ -150,7 +150,7 @@ export default { ...@@ -150,7 +150,7 @@ export default {
<span data-qa-selector="policies_tab" data-testid="policiesTabTitle">{{ <span data-qa-selector="policies_tab" data-testid="policiesTabTitle">{{
s__('Licenses|Policies') s__('Licenses|Policies')
}}</span> }}</span>
<gl-badge>{{ policyCount }}</gl-badge> <gl-badge size="sm" class="gl-tab-counter-badge">{{ policyCount }}</gl-badge>
</template> </template>
<license-management /> <license-management />
......
---
title: Counter badges are misaligned in License Compliance tabs
merge_request: 55517
author:
type: fixed
...@@ -177,7 +177,7 @@ describe('Project Licenses', () => { ...@@ -177,7 +177,7 @@ describe('Project Licenses', () => {
it('renders a "Detected in project" tab and a "Policies" tab', () => { it('renders a "Detected in project" tab and a "Policies" tab', () => {
expect(wrapper.find(GlTabs).exists()).toBe(true); expect(wrapper.find(GlTabs).exists()).toBe(true);
expect(wrapper.find(GlTab).exists()).toBe(true); expect(wrapper.find(GlTab).exists()).toBe(true);
expect(wrapper.findAll(GlTab)).toHaveLength(2); expect(wrapper.findAllComponents(GlTab)).toHaveLength(2);
}); });
it('it renders the "Detected in project" table', () => { it('it renders the "Detected in project" table', () => {
...@@ -279,11 +279,21 @@ describe('Project Licenses', () => { ...@@ -279,11 +279,21 @@ describe('Project Licenses', () => {
); );
it('it renders the correct count in "Detected in project" tab', () => { it('it renders the correct count in "Detected in project" tab', () => {
expect(wrapper.findAll(GlBadge).at(0).text()).toBe(pageInfo.total.toString()); expect(wrapper.findAllComponents(GlBadge).at(0).text()).toBe(pageInfo.total.toString());
}); });
it('it renders the correct count in "Policies" tab', () => { it('it renders the correct count in "Policies" tab', () => {
expect(wrapper.findAll(GlBadge).at(1).text()).toBe(managedLicenses.length.toString()); expect(wrapper.findAllComponents(GlBadge).at(1).text()).toBe(
managedLicenses.length.toString(),
);
});
it('it renders the correct type of badge styling', () => {
const badges = [
wrapper.findAllComponents(GlBadge).at(0),
wrapper.findAllComponents(GlBadge).at(1),
];
badges.forEach((badge) => expect(badge.classes()).toContain('gl-tab-counter-badge'));
}); });
}); });
......
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