test: align widget modernization fixtures
This commit is contained in:
1 parent
8775597d5a
commit
29f7c35fc1
1 file changed
+6
-21
@@ -1,16 +1,9 @@
|
|||||||
import { describe, expect, test } from "vitest";
|
import { describe, expect, test } from "vitest";
|
||||||
import { definition as appDefinition } from "./app";
|
import { definition as appDefinition } from "./app";
|
||||||
import { definition as beszelAlertsDefinition } from "./beszel-alerts";
|
|
||||||
import { definition as beszelSystemGridDefinition } from "./beszel-system-grid";
|
|
||||||
import { definition as beszelSystemStatsDefinition } from "./beszel-system-stats";
|
|
||||||
import { definition as beszelSystemTableDefinition } from "./beszel-system-table";
|
|
||||||
import { definition as clockDefinition } from "./clock";
|
|
||||||
import { definition as customApiDefinition } from "./custom-api";
|
import { definition as customApiDefinition } from "./custom-api";
|
||||||
import { getWidgetQueryKeys, supportsAdvancedFocus } from "./definition";
|
import { getWidgetQueryKeys, supportsAdvancedFocus } from "./definition";
|
||||||
import { definition as dockerDefinition } from "./docker";
|
import { definition as dockerDefinition } from "./docker";
|
||||||
import { definition as downloadsDefinition } from "./downloads";
|
import { definition as downloadsDefinition } from "./downloads";
|
||||||
import { definition as indexerManagerDefinition } from "./indexer-manager";
|
|
||||||
import { definition as notebookDefinition } from "./notebook";
|
|
||||||
|
|
||||||
describe("getWidgetQueryKeys", () => {
|
describe("getWidgetQueryKeys", () => {
|
||||||
test("falls back to the widget router namespace", () => {
|
test("falls back to the widget router namespace", () => {
|
||||||
@@ -32,20 +25,12 @@ describe("getWidgetQueryKeys", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe("supportsAdvancedFocus", () => {
|
describe("supportsAdvancedFocus", () => {
|
||||||
test.each([
|
test.each([appDefinition, dockerDefinition, customApiDefinition])(
|
||||||
appDefinition,
|
"keeps non-enhanced widgets compact",
|
||||||
beszelAlertsDefinition,
|
(widgetDefinition) => {
|
||||||
beszelSystemGridDefinition,
|
expect(supportsAdvancedFocus(widgetDefinition)).toBe(false);
|
||||||
beszelSystemStatsDefinition,
|
},
|
||||||
beszelSystemTableDefinition,
|
);
|
||||||
clockDefinition,
|
|
||||||
customApiDefinition,
|
|
||||||
dockerDefinition,
|
|
||||||
indexerManagerDefinition,
|
|
||||||
notebookDefinition,
|
|
||||||
])("keeps non-enhanced widgets compact", (widgetDefinition) => {
|
|
||||||
expect(supportsAdvancedFocus(widgetDefinition)).toBe(false);
|
|
||||||
});
|
|
||||||
|
|
||||||
test("requires an explicit opt-in", () => {
|
test("requires an explicit opt-in", () => {
|
||||||
expect(supportsAdvancedFocus({})).toBe(false);
|
expect(supportsAdvancedFocus({})).toBe(false);
|
||||||
|
|||||||
Reference in new issue
Block a user