feat: modernize dashboard widgets
This commit is contained in:
1 parent
1a5e083fd0
commit
6f2cd7fc2b
270 files changed
+10189
-3544
No files matched your search
@@ -0,0 +1,14 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
|
||||
import { clampPercentage, getDisplayText } from "./component";
|
||||
|
||||
describe("system disk display", () => {
|
||||
test("clamps malformed utilization before sizing the background", () => {
|
||||
expect(clampPercentage(-4)).toBe(0);
|
||||
expect(clampPercentage(108)).toBe(100);
|
||||
});
|
||||
|
||||
test("falls back to provider values when sizes are already formatted", () => {
|
||||
expect(getDisplayText({ used: "5 GiB", available: "10 GiB", percentage: 50 }, "absolute")).toBe("5 GiB / 10 GiB");
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user