feat: modernize dashboard widgets

This commit is contained in:
Thomas Camlong authored and ajnart committed 2026-08-14 11:07:07 +02:00
1 parent f3048f4804
commit a2763d1f6f
261 files changed
+9392 -2697

No files matched your search

+19
View File
@@ -0,0 +1,19 @@
import { describe, expect, test } from "vitest";
import { getWidgetQueryKeys } from "./definition";
describe("getWidgetQueryKeys", () => {
test("falls back to the widget router namespace", () => {
expect(getWidgetQueryKeys({ kind: "example" })).toEqual([[["widget", "example"]]]);
});
test("wraps a singular explicit key", () => {
expect(getWidgetQueryKeys({ kind: "example", queryKey: [["app", "byId"]] })).toEqual([[["app", "byId"]]]);
});
test("preserves every explicit key for multi-root widgets", () => {
const queryKeys = [[["widget", "audioStats"]], [["widget", "mediaServer"]]] as const;
expect(getWidgetQueryKeys({ kind: "audioStats", queryKeys })).toBe(queryKeys);
});
});