@labdigital/commercetools-mock 2.23.0 → 2.23.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labdigital/commercetools-mock",
3
- "version": "2.23.0",
3
+ "version": "2.23.1",
4
4
  "license": "MIT",
5
5
  "author": "Michael van Tellingen",
6
6
  "type": "module",
@@ -93,7 +93,11 @@ export class CustomObjectRepository extends AbstractResourceRepository<"key-valu
93
93
  });
94
94
 
95
95
  // @ts-ignore
96
- result.results = result.results.map(this.postProcessResource);
96
+ result.results = result.results.map((r) =>
97
+ this.postProcessResource(context, r as CustomObject, {
98
+ expand: params.expand,
99
+ }),
100
+ );
97
101
  return result;
98
102
  }
99
103
  }
@@ -75,6 +75,25 @@ describe("CustomObject retrieve", () => {
75
75
  expect(customObject.value).toBe("my-value");
76
76
  });
77
77
 
78
+ test("query with container", async () => {
79
+ const response = await supertest(ctMock.app)
80
+ .get("/dummy/custom-objects/my-container")
81
+ .send();
82
+
83
+ expect(response.status).toBe(200);
84
+ const customObjects = response.body;
85
+ expect(customObjects).toMatchObject({
86
+ results: [
87
+ {
88
+ container: "my-container",
89
+ key: "my-key",
90
+ value: "my-value",
91
+ },
92
+ ],
93
+ total: 1,
94
+ });
95
+ });
96
+
78
97
  test("Update match current (no conflict)", async () => {
79
98
  const response = await supertest(ctMock.app)
80
99
  .post("/dummy/custom-objects")