Live galleries fill themselves from their event (picks, or every ready photo) while the match is on; photos taken out by hand stay out. Clients mark favourites and comment (approved by the photographer); the app shows the selection, exports CSV, copies file names and labels the favourites in the library. Orders download as one ZIP, and free galleries get "download all". Fixes PATCH on galleries, sites and print events resetting fields to their defaults (a title change made a private gallery public). Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
18 lines
811 B
TypeScript
18 lines
811 B
TypeScript
import { describe, expect, it } from "vitest";
|
|
import { patchOf } from "./patch.js";
|
|
import { PrintEventInput } from "./print.js";
|
|
import { GalleryInput, SiteInput } from "./shop.js";
|
|
|
|
describe("patchOf", () => {
|
|
it("leaves out what the PATCH leaves out", () => {
|
|
expect(patchOf(GalleryInput).parse({ title: "Novo" })).toEqual({ title: "Novo" });
|
|
expect(patchOf(SiteInput).parse({ name: "PhotoReport" })).toEqual({ name: "PhotoReport" });
|
|
expect(patchOf(PrintEventInput).parse({ name: "Casamento" })).toEqual({ name: "Casamento" });
|
|
});
|
|
|
|
it("still validates what is sent", () => {
|
|
expect(() => patchOf(GalleryInput).parse({ visibility: "SECRET" })).toThrow();
|
|
expect(patchOf(GalleryInput).parse({ live: "PICKS", proofing: true })).toEqual({ live: "PICKS", proofing: true });
|
|
});
|
|
});
|