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,23 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { getAdvancedColumnWidth, getCompactSectionVisibility } from "./component";
|
||||
import { getAdvancedColumnWidth, getCompactSectionVisibility, getTracearrSectionVisibility } from "./component";
|
||||
import { attachTracearrSource } from "./source";
|
||||
|
||||
describe("Tracearr source ownership", () => {
|
||||
it("uses integration-scoped keys for overlapping upstream ids", () => {
|
||||
const first = attachTracearrSource([{ id: "same" }], {
|
||||
integrationId: "tracearr-a",
|
||||
integrationName: "Tracearr A",
|
||||
});
|
||||
const second = attachTracearrSource([{ id: "same" }], {
|
||||
integrationId: "tracearr-b",
|
||||
integrationName: "Tracearr B",
|
||||
});
|
||||
|
||||
expect([first[0]?.key, second[0]?.key]).toEqual(["tracearr-a:same", "tracearr-b:same"]);
|
||||
expect(second[0]?.integrationName).toBe("Tracearr B");
|
||||
});
|
||||
});
|
||||
|
||||
describe("Tracearr advanced layout", () => {
|
||||
it("subtracts grid padding and the inter-column gap", () => {
|
||||
@@ -38,3 +55,14 @@ describe("Tracearr compact disclosure", () => {
|
||||
).toEqual({ violations: true, recentActivity: true });
|
||||
});
|
||||
});
|
||||
|
||||
describe("Tracearr advanced disclosure", () => {
|
||||
it("shows all sections even when compact presentation toggles are disabled", () => {
|
||||
expect(
|
||||
getTracearrSectionVisibility(
|
||||
{ showStats: false, showStreams: false, showViolations: false, showRecentActivity: false },
|
||||
true,
|
||||
),
|
||||
).toEqual({ stats: true, streams: true, violations: true, recentActivity: true });
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user