diff --git a/ui/src/Components/Labels/LabelWithPercent/__snapshots__/index.test.js.snap b/ui/src/Components/Labels/LabelWithPercent/__snapshots__/index.test.js.snap index d87242fe6..1166f3198 100644 --- a/ui/src/Components/Labels/LabelWithPercent/__snapshots__/index.test.js.snap +++ b/ui/src/Components/Labels/LabelWithPercent/__snapshots__/index.test.js.snap @@ -20,7 +20,7 @@ exports[` matches snapshot 1`] = `
-
66 ? "bg-danger" - : percent > 66 + : percent > 33 ? "bg-warning" : "bg-success"; diff --git a/ui/src/Components/Labels/LabelWithPercent/index.test.js b/ui/src/Components/Labels/LabelWithPercent/index.test.js index 8d2a8e18f..9cbac15c9 100644 --- a/ui/src/Components/Labels/LabelWithPercent/index.test.js +++ b/ui/src/Components/Labels/LabelWithPercent/index.test.js @@ -60,4 +60,43 @@ describe("", () => { NewUnappliedFilter("foo!=bar") ); }); + + it("uses bg-danger when percent is >66", () => { + const tree = mount( + + ); + expect(tree.html()).toMatch(/progress-bar bg-danger/); + }); + + it("uses bg-warning when percent is >33", () => { + const tree = mount( + + ); + expect(tree.html()).toMatch(/progress-bar bg-warning/); + }); + + it("uses bg-success when percent is <=33", () => { + const tree = mount( + + ); + expect(tree.html()).toMatch(/progress-bar bg-success/); + }); }); diff --git a/ui/src/Components/OverviewModal/__snapshots__/OverviewModalContent.test.js.snap b/ui/src/Components/OverviewModal/__snapshots__/OverviewModalContent.test.js.snap index c1647fe93..e3b8fdc7b 100644 --- a/ui/src/Components/OverviewModal/__snapshots__/OverviewModalContent.test.js.snap +++ b/ui/src/Components/OverviewModal/__snapshots__/OverviewModalContent.test.js.snap @@ -52,7 +52,7 @@ exports[` matches snapshot with labels to show 1`] = `
-