feat: add branded editorial photo catalog

This commit is contained in:
Leon Tonhäuser committed 2026-08-09 22:22:31 +02:00
1 parent f6e6018cc1
commit 66f0599653
20 files changed
+1299 -36

No files matched your search

@@ -0,0 +1,62 @@
// @vitest-environment jsdom
import { render, screen } from "@testing-library/react";
import { expect, test } from "vitest";
import { AlbumContactSheet, PhotoContactSheet } from "./catalog-content";
test("renders granted albums as labelled contact-sheet links", () => {
render(
<AlbumContactSheet
albums={[
{
id: "heimspiel",
albumName: "Heimspiel gegen Nord",
description: null,
albumThumbnailAssetId: "cover-1",
assetCount: 24,
},
]}
/>,
);
const album = screen.getByRole("link", { name: /heimspiel gegen nord/i });
expect(album.getAttribute("href")).toBe("/redaktion/alben/heimspiel");
expect(screen.getByText("24 Fotos")).not.toBeNull();
expect(screen.getByAltText("Titelbild: Heimspiel gegen Nord").getAttribute("src")).toBe(
"/api/assets/cover-1/thumbnail",
);
});
test("renders a labelled photo search and descriptive contact-sheet metadata", () => {
render(
<PhotoContactSheet
albumName="Heimspiel gegen Nord"
page={{
items: [
{
id: "asset-1",
type: "IMAGE",
originalFileName: "tor-des-sieges.jpg",
originalMimeType: "image/jpeg",
localDateTime: "2026-08-08T18:42:00.000Z",
fileCreatedAt: null,
albums: [{ id: "heimspiel" }],
},
],
total: 1,
nextPage: null,
previousPage: null,
}}
query="Tor"
/>,
);
expect(screen.getByRole("search", { name: /fotos in heimspiel gegen nord durchsuchen/i })).not.toBeNull();
expect((screen.getByRole("searchbox", { name: /suchbegriff/i }) as HTMLInputElement).value).toBe("Tor");
expect(screen.getByAltText("tor-des-sieges.jpg").getAttribute("src")).toBe(
"/api/assets/asset-1/thumbnail",
);
expect(screen.getByText("tor-des-sieges.jpg")).not.toBeNull();
expect(screen.getByText(/1 foto gefunden/i)).not.toBeNull();
});