Chore: full react hooks eslint compliance (#7040)

This commit is contained in:
shamoon
2026-08-21 14:00:02 -07:00
committed by GitHub
parent 7c26cf6d97
commit 4c361422ca
111 changed files with 1072 additions and 867 deletions
+6 -3
View File
@@ -20,14 +20,17 @@ describe("widgets/unraid/component", () => {
vi.clearAllMocks();
});
it("defaults widget.fields and filters down to 4 visible blocks while loading", () => {
it("defaults fields and filters down to 4 visible blocks while loading", () => {
useWidgetAPI.mockReturnValue({ data: undefined, error: undefined });
const service = { widget: { type: "unraid" } };
const { container } = renderWithProviders(<Component service={service} />, { settings: { hideErrors: false } });
// Component sets default fields
expect(service.widget.fields).toEqual(["status", "cpu", "memoryPercent", "notifications"]);
expect(service.widget.fields).toBeUndefined();
expect(useWidgetAPI).toHaveBeenCalledWith({
type: "unraid",
fields: ["status", "cpu", "memoryPercent", "notifications"],
});
// Container filters the many placeholder Blocks down to the selected fields.
expect(container.querySelectorAll(".service-block")).toHaveLength(4);