refactor for better precision

This commit is contained in:
dswbx
2025-01-16 17:25:19 +01:00
parent 69ea5a00ee
commit 8a6d8329f3
2 changed files with 6 additions and 6 deletions

View File

@@ -5,9 +5,9 @@ describe("DataApi", () => {
it("should switch to post for long url reads", async () => {
const api = new DataApi();
const get = api.readMany("a".repeat(100), { select: ["id", "name"] });
const get = api.readMany("a".repeat(300), { select: ["id", "name"] });
expect(get.request.method).toBe("GET");
expect(new URL(get.request.url).pathname).toBe(`/api/data/${"a".repeat(100)}`);
expect(new URL(get.request.url).pathname).toBe(`/api/data/${"a".repeat(300)}`);
const post = api.readMany("a".repeat(1000), { select: ["id", "name"] });
expect(post.request.method).toBe("POST");