mirror of
https://github.com/gethomepage/homepage.git
synced 2026-09-26 05:51:17 -07:00
20 lines
571 B
JavaScript
20 lines
571 B
JavaScript
import { describe, expect, it } from "vitest";
|
|
|
|
import { expectWidgetConfigShape } from "test-utils/widget-config";
|
|
|
|
import widget from "./widget";
|
|
|
|
describe("unmanic widget config", () => {
|
|
it("exports a valid widget config", () => {
|
|
expectWidgetConfigShape(widget);
|
|
});
|
|
|
|
it("counts total and active workers", () => {
|
|
const result = widget.mappings.workers.map(
|
|
Buffer.from(JSON.stringify({ workers_status: [{ idle: true }, { idle: false }, { idle: false }] })),
|
|
);
|
|
|
|
expect(result).toEqual({ total_workers: 3, active_workers: 2 });
|
|
});
|
|
});
|