feat: refine widget interactions
This commit is contained in:
1 parent
a8a7545f40
commit
842e86012d
107 files changed
+3144
-1233
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { getAdvancedColumnWidth } from "./component";
|
||||
import { getAdvancedColumnWidth, getCompactSectionVisibility } from "./component";
|
||||
|
||||
describe("Tracearr advanced layout", () => {
|
||||
it("subtracts grid padding and the inter-column gap", () => {
|
||||
@@ -12,3 +12,29 @@ describe("Tracearr advanced layout", () => {
|
||||
expect(getAdvancedColumnWidth(799, false)).toBe(767);
|
||||
});
|
||||
});
|
||||
|
||||
describe("Tracearr compact disclosure", () => {
|
||||
it("keeps urgent violations visible in a short widget", () => {
|
||||
expect(
|
||||
getCompactSectionVisibility({
|
||||
height: 160,
|
||||
showStreams: true,
|
||||
showViolations: true,
|
||||
hasViolations: true,
|
||||
showRecentActivity: true,
|
||||
}),
|
||||
).toEqual({ violations: true, recentActivity: false });
|
||||
});
|
||||
|
||||
it("reveals secondary history as height becomes available", () => {
|
||||
expect(
|
||||
getCompactSectionVisibility({
|
||||
height: 400,
|
||||
showStreams: true,
|
||||
showViolations: true,
|
||||
hasViolations: false,
|
||||
showRecentActivity: true,
|
||||
}),
|
||||
).toEqual({ violations: true, recentActivity: true });
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user