Fix: admin list products expand integration test (#974)
This commit is contained in:
1 parent
7fcdac51ea
commit
24175025d1
1 file changed
+39
@@ -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 () => {
|
it("returns a list of deleted products with free text query", async () => {
|
||||||
const api = useApi()
|
const api = useApi()
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user