mirror of
https://github.com/gethomepage/homepage.git
synced 2026-02-08 00:40:52 +08:00
test: add widget config tests (batch 2)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user