Add these private widget options

This commit is contained in:
shamoon
2026-09-22 19:04:27 -07:00
parent 3b18dc1f45
commit cf1964d652
2 changed files with 16 additions and 2 deletions
+11
View File
@@ -60,6 +60,17 @@ describe("utils/config/widget-helpers", () => {
expect(cleaned[2].options.apiKey).toBeUndefined();
});
it("cleanWidgetGroups removes customapi request options", async () => {
const cleaned = await cleanWidgetGroups([
{
type: "customapi",
options: { index: 0, url: "http://x", headers: { a: "b" }, requestBody: "body", method: "POST", icon: "mdi-x" },
},
]);
expect(cleaned[0].options).toEqual({ index: 0, icon: "mdi-x" });
});
it("getPrivateWidgetOptions returns private options for a specific widget", async () => {
fs.readFile.mockResolvedValueOnce("ignored");
yaml.load.mockReturnValueOnce([{ search: { url: "http://x", username: "u", password: "p", key: "k" } }]);