test: add widget config tests (batch 2)

This commit is contained in:
shamoon
2026-02-04 09:59:32 -08:00
parent d29854f710
commit fa89f68cdc
21 changed files with 222 additions and 2 deletions

View File

@@ -6,8 +6,8 @@ export function expectWidgetConfigShape(widget) {
if ("api" in widget) {
expect(widget.api).toBeTypeOf("string");
// Widget APIs are template strings that expand to a configured service URL.
expect(widget.api).toContain("{url}");
// Widget APIs are either service-backed (`{url}` template) or third-party API URLs.
expect(widget.api.includes("{url}") || /^https?:\/\//.test(widget.api)).toBe(true);
}
if ("proxyHandler" in widget) {