Initial human archive app
Some checks failed
Build and publish Docker image / docker (push) Failing after 2m33s

This commit is contained in:
2026-06-26 21:31:46 +02:00
parent ee2a0202d7
commit f29339cf12
38 changed files with 3644 additions and 112 deletions

View File

@@ -0,0 +1,33 @@
import { describe, expect, it } from "vitest";
import { validateSources } from "@/lib/moderation";
describe("validateSources", () => {
it("requires at least one source", () => {
expect(validateSources([])).toContain("missing_sources");
});
it("requires a valid URL and license", () => {
expect(
validateSources([
{
title: "Archive",
url: "not-a-url",
language: "DE",
},
]),
).toEqual(expect.arrayContaining(["source_invalid_url", "source_missing_license"]));
});
it("accepts sourced material with licensing metadata", () => {
expect(
validateSources([
{
title: "Public record",
url: "https://example.org/source",
language: "EN",
license: "CC BY 4.0",
},
]),
).toEqual([]);
});
});