refactor(data): replace schema classes with readonly models
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
import { renderToStaticMarkup } from "react-dom/server";
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { PrivateAlbum } from "@/data/schemas/private-room";
|
||||
import {
|
||||
PrivateAlbumSchema,
|
||||
type PrivateAlbum,
|
||||
type PrivateAlbumInput,
|
||||
} from "@/data/schemas/private-room";
|
||||
|
||||
import { PrivateAlbumCard } from "../private-album-card";
|
||||
|
||||
const COVER_URL = "/images/private-room/banner.png";
|
||||
|
||||
function makeAlbum(
|
||||
overrides: Partial<Parameters<typeof PrivateAlbum.from>[0]> = {},
|
||||
): PrivateAlbum {
|
||||
return PrivateAlbum.from({
|
||||
function makeAlbum(overrides: Partial<PrivateAlbumInput> = {}): PrivateAlbum {
|
||||
return PrivateAlbumSchema.parse({
|
||||
albumId: "album-1",
|
||||
title: "Private morning",
|
||||
content: "A quiet morning by the water.",
|
||||
@@ -61,9 +63,7 @@ describe("PrivateAlbumCard", () => {
|
||||
expect(html).toContain("8 photos");
|
||||
expect(html).toContain("A quiet morning by the water.");
|
||||
expect(html).toContain('aria-label="Open 8 private album photos"');
|
||||
expect(html).toContain(
|
||||
'data-analytics-key="private_album.open_gallery"',
|
||||
);
|
||||
expect(html).toContain('data-analytics-key="private_album.open_gallery"');
|
||||
});
|
||||
|
||||
it("uses the backend first image as the locked cover", () => {
|
||||
|
||||
Reference in New Issue
Block a user