fix(web,api): lecteur PDF — options pdf.js, assets cmaps/fonts et recherche sans limite par défaut
This commit is contained in:
@ -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 }), {
|
||||
|
||||
Reference in New Issue
Block a user