diff --git a/integration-tests/api/__tests__/admin/product.js b/integration-tests/api/__tests__/admin/product.js index 0816d9e4b0..3a9a83d68f 100644 --- a/integration-tests/api/__tests__/admin/product.js +++ b/integration-tests/api/__tests__/admin/product.js @@ -178,6 +178,45 @@ describe("/admin/products", () => { } }) + it("doesn't expand collection and types", async () => { + const api = useApi() + + const notExpected = [ + expect.objectContaining({ + collection: expect.any(Object), + type: expect.any(Object), + }), + ] + + const response = await api + .get("/admin/products?status[]=published,proposed&expand=tags", { + headers: { + Authorization: "Bearer test_token", + }, + }) + .catch((err) => { + console.log(err) + }) + + expect(response.status).toEqual(200) + expect(response.data.products).toEqual([ + expect.objectContaining({ + id: "test-product_filtering_1", + status: "proposed", + }), + expect.objectContaining({ + id: "test-product_filtering_2", + status: "published", + }), + ]) + + for (const notExpect of notExpected) { + expect(response.data.products).toEqual( + expect.not.arrayContaining([notExpect]) + ) + } + }) + it("returns a list of deleted products with free text query", async () => { const api = useApi()