Fix: admin list products expand integration test (#974)
This commit is contained in:
@@ -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()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user