feat: expand advanced widget experiences
This commit is contained in:
1 parent
9437d211c8
commit
c099a8eef6
119 files changed
+3624
-844
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, test } from "vitest";
|
||||
|
||||
import { getGridCols, shouldShowComplianceHeroText } from "../layout-utils";
|
||||
import { getGridCols, getVisiblePatchMonStatKeys, shouldShowComplianceHeroText } from "../layout-utils";
|
||||
|
||||
describe("getGridCols", () => {
|
||||
test("returns 1 column for narrow widths", () => {
|
||||
@@ -34,3 +34,31 @@ describe("shouldShowComplianceHeroText", () => {
|
||||
expect(shouldShowComplianceHeroText(384)).toBe(true);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getVisiblePatchMonStatKeys", () => {
|
||||
test("keeps compact visibility choices", () => {
|
||||
expect(
|
||||
getVisiblePatchMonStatKeys(
|
||||
{
|
||||
showTotalHosts: true,
|
||||
showSecurityUpdates: true,
|
||||
showTotalRepos: false,
|
||||
},
|
||||
false,
|
||||
),
|
||||
).toEqual(["totalHosts", "securityUpdates"]);
|
||||
});
|
||||
|
||||
test("returns every owned statistic in advanced mode", () => {
|
||||
expect(getVisiblePatchMonStatKeys({}, true)).toEqual([
|
||||
"totalHosts",
|
||||
"hostsNeedingUpdates",
|
||||
"securityUpdates",
|
||||
"upToDateHosts",
|
||||
"hostsWithSecurityUpdates",
|
||||
"recentUpdates24h",
|
||||
"totalOutdatedPackages",
|
||||
"totalRepos",
|
||||
]);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user