Chorehancement: add fileflows widget v2 for 26.10 breaking changes (#7239)

This commit is contained in:
shamoon
2026-10-10 08:10:15 -07:00
committed by GitHub
parent 447c4f1467
commit 03ad0e5d30
8 changed files with 59 additions and 8 deletions
+19
View File
@@ -62,4 +62,23 @@ describe("widgets/fileflows/component", () => {
expectBlockValue(container, "fileflows.processed", 3);
expectBlockValue(container, "fileflows.time", "0:00");
});
it("uses the webhook endpoint and fields for version 2", () => {
useWidgetAPI.mockReturnValue({
data: { Unprocessed: 4, Processing: 1, Processed: 10, Failed: 2 },
error: undefined,
});
const widget = { type: "fileflows", url: "http://x", version: 2 };
const { container } = renderWithProviders(<Component service={{ widget }} />, {
settings: { hideErrors: false },
});
expect(useWidgetAPI).toHaveBeenCalledWith(widget, "status_v2");
expectBlockValue(container, "fileflows.queue", 4);
expectBlockValue(container, "fileflows.processing", 1);
expectBlockValue(container, "fileflows.processed", 10);
expectBlockValue(container, "fileflows.failed", 2);
expect(screen.queryByText("fileflows.time")).not.toBeInTheDocument();
});
});