Web frontend: perf panel, cover warmup, incremental browse rendering
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
20
web/src/api/__tests__/client.test.ts
Normal file
20
web/src/api/__tests__/client.test.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { coverUrl } from "../client";
|
||||
|
||||
describe("coverUrl", () => {
|
||||
it("is the plain full-size URL with no options", () => {
|
||||
expect(coverUrl("abc")).toBe("/api/albums/abc/cover");
|
||||
});
|
||||
|
||||
it("asks for the thumbnail and carries the cache-busting version", () => {
|
||||
expect(coverUrl("abc", { size: "thumb", version: 42 })).toBe(
|
||||
"/api/albums/abc/cover?size=thumb&v=42",
|
||||
);
|
||||
});
|
||||
|
||||
it("leaves the version off when there is none, so the server revalidates", () => {
|
||||
expect(coverUrl("abc", { size: "thumb" })).toBe("/api/albums/abc/cover?size=thumb");
|
||||
expect(coverUrl("abc", { version: 0 })).toBe("/api/albums/abc/cover");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user