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 { PortalShell } from "@/components/layout/portal-shell";
|
||||||
import { BrandLogo } from "./logo";
|
import { BrandLogo } from "./logo";
|
||||||
|
|
||||||
test("uses each supplied logo's true intrinsic dimensions", () => {
|
test("uses the supplied logo's true intrinsic dimensions", () => {
|
||||||
const { rerender } = render(<BrandLogo variant="white" />);
|
render(<BrandLogo />);
|
||||||
const logo = screen.getByAltText("Leon Tonhäuser Sportfotografie");
|
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("width")).toBe("1000");
|
||||||
expect(logo.getAttribute("height")).toBe("1000");
|
expect(logo.getAttribute("height")).toBe("1000");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,17 +1,20 @@
|
|||||||
import React from "react";
|
import React from "react";
|
||||||
|
|
||||||
type PageHeaderProps = {
|
type PageHeaderProps = {
|
||||||
kicker: string;
|
kicker?: string;
|
||||||
title: string;
|
title: string;
|
||||||
description?: 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 (
|
return (
|
||||||
<div className="editorial-section">
|
<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">
|
<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>
|
</div>
|
||||||
{description && (
|
{description && (
|
||||||
<p className="text-lg text-muted-foreground max-w-3xl mb-8">
|
<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(second).toEqual(first);
|
||||||
expect(usages).toHaveLength(1);
|
expect(usages).toHaveLength(1);
|
||||||
expect(usages[0]).toMatchObject({ editorialId, assetId, albumId, idempotencyKey });
|
expect(usages[0]).toMatchObject({ editorialId, assetId, albumId, idempotencyKey });
|
||||||
expect(immich.listAlbumsForAsset).toHaveBeenCalledWith(assetId);
|
expect(immich.getAlbum).toHaveBeenCalledWith(albumId);
|
||||||
expect(immich.getAsset).toHaveBeenCalledWith(assetId);
|
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 () => {
|
test("persists metadata from the locked final Immich refresh", async () => {
|
||||||
const { service, immich, usages } = createService();
|
const { service, immich, usages } = createService();
|
||||||
immich.getAsset
|
immich.getAlbum
|
||||||
.mockResolvedValueOnce({
|
.mockResolvedValueOnce({
|
||||||
id: assetId,
|
id: albumId,
|
||||||
type: "IMAGE" as const,
|
albumName: "Presse 2026",
|
||||||
originalFileName: "jubel.jpg",
|
|
||||||
originalMimeType: "image/jpeg",
|
|
||||||
albums: [{ id: albumId }],
|
|
||||||
})
|
})
|
||||||
.mockResolvedValueOnce([
|
.mockResolvedValueOnce({
|
||||||
{
|
id: albumId,
|
||||||
id: albumId,
|
albumName: "Presse final",
|
||||||
albumName: "Presse final",
|
});
|
||||||
description: null,
|
|
||||||
albumThumbnailAssetId: assetId,
|
|
||||||
assetCount: 1,
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
const currentAsset = {
|
const currentAsset = {
|
||||||
id: assetId,
|
id: assetId,
|
||||||
type: "IMAGE" as const,
|
type: "IMAGE" as const,
|
||||||
|
|||||||
@@ -197,7 +197,7 @@ test("0002 preserves dirty rows and reconstructs only provable legacy intents",
|
|||||||
await testDb.applyRemainingMigrations();
|
await testDb.applyRemainingMigrations();
|
||||||
|
|
||||||
const immich = {
|
const immich = {
|
||||||
listAlbumsForAsset: vi.fn(),
|
getAlbum: vi.fn(),
|
||||||
getAsset: vi.fn(),
|
getAsset: vi.fn(),
|
||||||
};
|
};
|
||||||
const usageService = createUsageService({
|
const usageService = createUsageService({
|
||||||
|
|||||||
Reference in new issue
Block a user