fix(order): searchable fields (#9493)

FIXES: TRI-353
This commit is contained in:
Carlos R. L. Rodrigues
2024-10-07 14:45:20 -03:00
committed by GitHub
parent dc9c23be34
commit 8fbef8a667
6 changed files with 45 additions and 11 deletions

View File

@@ -140,6 +140,23 @@ medusaIntegrationTestRunner({
.order
})
it("should find the order querying it by number", async () => {
const userEmail = "tony@stark-industries.com"
const response = (
await api.get(`/admin/orders/?q=non-existing`, adminHeaders)
).data
expect(response.orders).toHaveLength(0)
const response2 = (
await api.get(`/admin/orders/?fields=+email&q=@stark`, adminHeaders)
).data
expect(response2.orders).toHaveLength(1)
expect(response2.orders[0].email).toEqual(userEmail)
})
it("should only create fulfillments grouped by shipping requirement", async () => {
const {
response: { data },