fix(web,api): lecteur PDF — options pdf.js, assets cmaps/fonts et recherche sans limite par défaut

This commit is contained in:
Git Agent
2026-08-24 14:15:25 +02:00
parent f8c8ffd45c
commit b3bd678291
14 changed files with 336 additions and 31 deletions

View File

@ -14,6 +14,34 @@ describe("api fallback helpers", () => {
expect(getApiFallback<string[]>(new Error("boom"))).toBeUndefined();
});
it("does not cap the home catalogue request to the first 50 books", async () => {
const fetchMock = vi.fn().mockResolvedValue(
new Response(JSON.stringify([]), {
status: 200,
headers: { "Content-Type": "application/json" }
})
);
vi.stubGlobal("fetch", fetchMock);
await api.books();
expect(String(fetchMock.mock.calls[0][0])).not.toContain("limit=50");
});
it("does not cap search requests to the first 50 books", async () => {
const fetchMock = vi.fn().mockResolvedValue(
new Response(JSON.stringify([]), {
status: 200,
headers: { "Content-Type": "application/json" }
})
);
vi.stubGlobal("fetch", fetchMock);
await api.search("daredevil");
expect(String(fetchMock.mock.calls[0][0])).not.toContain("limit=50");
});
it("does not send JSON content-type for bodyless delete requests", async () => {
const fetchMock = vi.fn().mockResolvedValue(
new Response(JSON.stringify({ ok: true }), {