fix(widgets): restore compact v1 surfaces (#6710)
This commit is contained in:
1 parent
1b2f1bd720
commit
643ecf3df7
105 files changed
+1603
-1285
No files matched your search
@@ -1,7 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { aggregateUptimeKumaDashboards } from "./aggregate";
|
||||
import { getCompactStatLimit, getCompactStatPriority } from "./component";
|
||||
|
||||
describe("aggregateUptimeKumaDashboards", () => {
|
||||
it("weights uptime by monitors instead of integrations", () => {
|
||||
@@ -30,26 +29,3 @@ describe("aggregateUptimeKumaDashboards", () => {
|
||||
expect(combined.averageUptimePercent).toBe(25);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getCompactStatLimit", () => {
|
||||
it("reserves compact height for the uptime summary", () => {
|
||||
expect(getCompactStatLimit(150, true, 4)).toBe(0);
|
||||
expect(getCompactStatLimit(220, true, 4)).toBe(2);
|
||||
});
|
||||
|
||||
it("uses the space for metrics when the summary is disabled", () => {
|
||||
expect(getCompactStatLimit(100, false, 4)).toBe(2);
|
||||
expect(getCompactStatLimit(240, false, 4)).toBe(4);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getCompactStatPriority", () => {
|
||||
it("puts active failures before healthy totals", () => {
|
||||
expect(getCompactStatPriority("downCount", 2)).toBeLessThan(getCompactStatPriority("totalMonitors", 10));
|
||||
expect(getCompactStatPriority("pausedCount", 1)).toBeLessThan(getCompactStatPriority("upCount", 8));
|
||||
});
|
||||
|
||||
it("moves zero-value problem states behind healthy totals", () => {
|
||||
expect(getCompactStatPriority("downCount", 0)).toBeGreaterThan(getCompactStatPriority("upCount", 8));
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user