Skip to content

Commit

Permalink
Update batch unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bprucha committed May 31, 2021
1 parent 012e041 commit 0f9b65f
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/o.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,7 @@ describe("Batching", () => {
const data = await oHandler.get(resource1).get(resource2).batch();
// expect
expect(data.length).toBe(2);
expect(data[0].length).toBeDefined();
expect(data[0].body.length).toBeDefined();
});

test("Batch multiple GET requests and allow to add a query", async () => {
Expand All @@ -466,7 +466,7 @@ describe("Batching", () => {
.get(resource2)
.batch({ $top: 2 });
// expect
expect(data[0].length).toBe(2);
expect(data[0].body.length).toBe(2);
});

test("Batch multiple GET requests and patch something", async () => {
Expand All @@ -480,8 +480,8 @@ describe("Batching", () => {
.batch();
// expect
expect(data.length).toBe(3);
expect(data[1]).toBe(204);
expect(data[2].Name).toBe("New");
expect(data[1].status).toBe(204);
expect(data[2].body.Name).toBe("New");
});

test("Batch POST and PATCH with useChangeset=true", async () => {
Expand All @@ -502,8 +502,8 @@ describe("Batching", () => {
const data = await request.batch();
// expect
expect(data.length).toBe(2);
expect(data[0].LastName).toBe(resouce1data.LastName);
expect(data[1]).toBe(204);
expect(data[0].body.LastName).toBe(resouce1data.LastName);
expect(data[1].status).toBe(204);
});

// Content ID seems to have a problem in the test implementation (or I don't get the right implementation)
Expand All @@ -525,7 +525,7 @@ describe("Batching", () => {
.batch();
// expect
expect(result.length).toBe(3);
expect(result[1]).toBe(204);
expect(result[2].LastName).toBe("Bar");
expect(result[1].status).toBe(204);
expect(result[2].body.LastName).toBe("Bar");
});
});

0 comments on commit 0f9b65f

Please sign in to comment.