Skip to content

Commit 9c2fb00

Browse files
authored
fix: show truthful percents on doughnuts (#3077)
1 parent 5e503fc commit 9c2fb00

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/containers/Cluster/ClusterOverview/utils.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ export function getDiagramValues({
3434
}) {
3535
const parsedValue = parseFloat(String(value));
3636
const parsedCapacity = parseFloat(String(capacity));
37-
let fillWidth = (parsedValue / parsedCapacity) * 100 || 0;
38-
fillWidth = fillWidth > 100 ? 100 : fillWidth;
37+
const fillWidth = (parsedValue / parsedCapacity) * 100 || 0;
3938

4039
const legend = legendFormatter({
4140
value: parsedValue,

tests/suites/sidebar/sidebar.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ test.describe('Test Sidebar', async () => {
6363
test('Information popup contains documentation and keyboard shortcuts', async ({page}) => {
6464
const sidebar = new Sidebar(page);
6565
await sidebar.waitForSidebarToLoad();
66+
await page.waitForTimeout(1000); // Wait for page to load fully
6667

6768
// Click the Information button to open the popup
6869
await sidebar.clickInformation();
@@ -83,6 +84,7 @@ test.describe('Test Sidebar', async () => {
8384
}) => {
8485
const sidebar = new Sidebar(page);
8586
await sidebar.waitForSidebarToLoad();
87+
await page.waitForTimeout(1000); // Wait for page to load fully
8688

8789
// Click the Information button to open the popup
8890
await sidebar.clickInformation();

0 commit comments

Comments
 (0)