Polish Workshop and custom widget docs
This commit is contained in:
20 files changed
+733
-492
No files matched your search
@@ -2,7 +2,7 @@ import { describe, expect, test } from "vitest";
|
||||
|
||||
import { CUSTOM_WIDGET_STARTER } from "@homarr/custom-widgets/core";
|
||||
|
||||
import { validateWorkshopWidget, workshopSubmissionInputSchema } from "./schema";
|
||||
import { validateWorkshopWidget, workshopSubmissionInputSchema, workshopSubmissionSummarySchema } from "./schema";
|
||||
|
||||
describe("Workshop widget validation", () => {
|
||||
test("accepts a canonical credential-free widget", () => {
|
||||
@@ -55,6 +55,25 @@ describe("Workshop widget validation", () => {
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
test("normalizes PocketBase records before rendering", () => {
|
||||
const result = workshopSubmissionSummarySchema.parse({
|
||||
id: "jzyxskmimxn42io",
|
||||
title: "Tautulli Activity",
|
||||
description: "Shows active Plex streams from Tautulli",
|
||||
widgetSchema: "homarr-custom-widget-v2",
|
||||
screenshots: "[]",
|
||||
author: "wsqylmotymtqpox",
|
||||
revision: 1,
|
||||
created: "2026-07-21 14:19:25.790Z",
|
||||
updated: "2026-07-21 14:19:25.790Z",
|
||||
});
|
||||
|
||||
expect(result.type).toBe("customWidget");
|
||||
expect(result.screenshots).toEqual([]);
|
||||
expect(result.authorName).toBe("Community member");
|
||||
expect(result.upvotes).toBe(0);
|
||||
});
|
||||
|
||||
test("rejects literal credentials in templates and icon URLs", () => {
|
||||
expect(
|
||||
validateWorkshopWidget(
|
||||
|
||||
Reference in new issue
Block a user