mirror of
https://github.com/gethomepage/homepage.git
synced 2026-02-08 08:50:52 +08:00
test: add widget config tests (batch 1)
This commit is contained in:
16
src/widgets/bazarr/widget.test.js
Normal file
16
src/widgets/bazarr/widget.test.js
Normal file
@@ -0,0 +1,16 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { expectWidgetConfigShape } from "test-utils/widget-config";
|
||||
|
||||
import widget from "./widget";
|
||||
|
||||
describe("bazarr widget config", () => {
|
||||
it("exports a valid widget config", () => {
|
||||
expectWidgetConfigShape(widget);
|
||||
expect(widget.api).toContain("apikey={key}");
|
||||
|
||||
const moviesMapping = widget.mappings?.movies;
|
||||
expect(moviesMapping?.endpoint).toBe("movies");
|
||||
expect(moviesMapping?.map?.('{"total":123}')).toEqual({ total: 123 });
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user