fix(workshop): expose moderation

This commit is contained in:
Thomas Camlong committed 2026-08-10 17:37:13 +02:00
1 parent be93fb330a
commit 378bc0cd28
13 files changed
+58 -12

No files matched your search

+5
View File
@@ -8,6 +8,7 @@ import {
normalizeHttpUrl,
resolveHomarrUrlConfig,
validateWorkshopWidget,
workshopReportCategorySchema,
workshopSubmissionInputSchema,
workshopSubmissionSummarySchema,
} from "./schema";
@@ -40,6 +41,10 @@ describe("Workshop URL configuration", () => {
});
describe("Workshop widget validation", () => {
test("accepts outdated as a report category", () => {
expect(workshopReportCategorySchema.parse("outdated")).toBe("outdated");
});
test("accepts a canonical credential-free widget", () => {
expect(validateWorkshopWidget(JSON.stringify(CUSTOM_WIDGET_STARTER)).success).toBe(true);
expect(
+8 -1
View File
@@ -73,7 +73,14 @@ export function resolveHomarrUrlConfig(input: HomarrUrlConfigInput = {}): Homarr
return { homarrWebsiteUrl, workshopApiUrl, workshopWebUrl };
}
export const workshopReportCategorySchema = z.enum(["malicious", "spam", "copyright", "inappropriate", "other"]);
export const workshopReportCategorySchema = z.enum([
"outdated",
"malicious",
"spam",
"copyright",
"inappropriate",
"other",
]);
export const workshopSubmissionTypeSchema = z.enum(["customWidget", "customCss"]);
export type WorkshopSubmissionType = z.infer<typeof workshopSubmissionTypeSchema>;