fix(medusa): Free text search for PriceList Products (#1843)

**What**
Fixes #1831 and #1336
This commit is contained in:
Oliver Windall Juhl
2022-07-13 16:06:33 +02:00
committed by GitHub
parent cbdc5b7774
commit 7162972318
4 changed files with 41 additions and 14 deletions
@@ -1244,6 +1244,29 @@ describe("/admin/price-lists", () => {
expect.objectContaining({ id: "test-prod-2" }),
])
})
it("lists products using free text search", async () => {
const api = useApi()
const response = await api
.get(`/admin/price-lists/test-list/products?q=MedusaHeadphones`, {
headers: {
Authorization: "Bearer test_token",
},
})
.catch((err) => {
console.warn(err.response.data)
})
expect(response.status).toEqual(200)
expect(response.data.count).toEqual(1)
expect(response.data.products).toEqual([
expect.objectContaining({
id: "test-prod-1",
title: "MedusaHeadphones",
}),
])
})
})
describe("delete prices from price list related to the specified product or variant", () => {