fix: type errors
This commit is contained in:
1 parent
6631530dcb
commit
f4c06cbc95
4 files changed
+18
-27
No files matched your search
@@ -8,13 +8,9 @@ import { expect, test } from "vitest";
|
||||
import { PortalShell } from "@/components/layout/portal-shell";
|
||||
import { BrandLogo } from "./logo";
|
||||
|
||||
test("uses each supplied logo's true intrinsic dimensions", () => {
|
||||
const { rerender } = render(<BrandLogo variant="white" />);
|
||||
test("uses the supplied logo's true intrinsic dimensions", () => {
|
||||
render(<BrandLogo />);
|
||||
const logo = screen.getByAltText("Leon Tonhäuser Sportfotografie");
|
||||
expect(logo.getAttribute("width")).toBe("250");
|
||||
expect(logo.getAttribute("height")).toBe("250");
|
||||
|
||||
rerender(<BrandLogo variant="black" />);
|
||||
expect(logo.getAttribute("width")).toBe("1000");
|
||||
expect(logo.getAttribute("height")).toBe("1000");
|
||||
});
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
import React from "react";
|
||||
|
||||
type PageHeaderProps = {
|
||||
kicker: string;
|
||||
kicker?: string;
|
||||
title: string;
|
||||
description?: string;
|
||||
titleId?: string;
|
||||
children?: React.ReactNode;
|
||||
};
|
||||
|
||||
export function PageHeader({ kicker, title, description }: PageHeaderProps) {
|
||||
export function PageHeader({ kicker, title, description, titleId, children }: PageHeaderProps) {
|
||||
return (
|
||||
<div className="editorial-section">
|
||||
<p className="editorial-kicker text-sm font-semibold text-muted-foreground tracking-widest uppercase mb-2">{kicker}</p>
|
||||
{kicker && <p className="editorial-kicker text-sm font-semibold text-muted-foreground tracking-widest uppercase mb-2">{kicker}</p>}
|
||||
<div className="editorial-title-row mb-6">
|
||||
<h1 className="text-4xl font-bold tracking-tight text-foreground">{title}</h1>
|
||||
<h1 id={titleId} className="text-4xl font-bold tracking-tight text-foreground">{title}</h1>
|
||||
{children}
|
||||
</div>
|
||||
{description && (
|
||||
<p className="text-lg text-muted-foreground max-w-3xl mb-8">
|
||||
|
||||
@@ -155,7 +155,7 @@ test("canonicalizes every UUID before fingerprinting, lookup, Immich calls, and
|
||||
expect(second).toEqual(first);
|
||||
expect(usages).toHaveLength(1);
|
||||
expect(usages[0]).toMatchObject({ editorialId, assetId, albumId, idempotencyKey });
|
||||
expect(immich.listAlbumsForAsset).toHaveBeenCalledWith(assetId);
|
||||
expect(immich.getAlbum).toHaveBeenCalledWith(albumId);
|
||||
expect(immich.getAsset).toHaveBeenCalledWith(assetId);
|
||||
});
|
||||
|
||||
@@ -273,23 +273,15 @@ test("rejects removal from the requested album between preflight and locked refr
|
||||
|
||||
test("persists metadata from the locked final Immich refresh", async () => {
|
||||
const { service, immich, usages } = createService();
|
||||
immich.getAsset
|
||||
immich.getAlbum
|
||||
.mockResolvedValueOnce({
|
||||
id: assetId,
|
||||
type: "IMAGE" as const,
|
||||
originalFileName: "jubel.jpg",
|
||||
originalMimeType: "image/jpeg",
|
||||
albums: [{ id: albumId }],
|
||||
id: albumId,
|
||||
albumName: "Presse 2026",
|
||||
})
|
||||
.mockResolvedValueOnce([
|
||||
{
|
||||
id: albumId,
|
||||
albumName: "Presse final",
|
||||
description: null,
|
||||
albumThumbnailAssetId: assetId,
|
||||
assetCount: 1,
|
||||
},
|
||||
]);
|
||||
.mockResolvedValueOnce({
|
||||
id: albumId,
|
||||
albumName: "Presse final",
|
||||
});
|
||||
const currentAsset = {
|
||||
id: assetId,
|
||||
type: "IMAGE" as const,
|
||||
|
||||
@@ -197,7 +197,7 @@ test("0002 preserves dirty rows and reconstructs only provable legacy intents",
|
||||
await testDb.applyRemainingMigrations();
|
||||
|
||||
const immich = {
|
||||
listAlbumsForAsset: vi.fn(),
|
||||
getAlbum: vi.fn(),
|
||||
getAsset: vi.fn(),
|
||||
};
|
||||
const usageService = createUsageService({
|
||||
|
||||
Reference in new issue
Block a user