feat(medusa): Allow empty fields/expand (#3220)
This commit is contained in:
committed by
GitHub
parent
61b0b2f3aa
commit
eee9283818
@@ -1545,6 +1545,30 @@ describe("/admin/orders", () => {
|
||||
)
|
||||
})
|
||||
|
||||
it("lists orders with specific fields and relations", async () => {
|
||||
const api = useApi()
|
||||
|
||||
const response = await api.get(
|
||||
"/admin/orders?fields=id,created_at&expand=billing_address",
|
||||
adminReqConfig
|
||||
)
|
||||
|
||||
expect(response.status).toEqual(200)
|
||||
expect(response.data.orders).toHaveLength(6)
|
||||
expect(response.data.orders).toEqual(
|
||||
expect.arrayContaining([
|
||||
{
|
||||
id: "test-order",
|
||||
created_at: expect.any(String),
|
||||
billing_address: expect.objectContaining({
|
||||
id: "test-billing-address",
|
||||
first_name: "lebron",
|
||||
}),
|
||||
},
|
||||
])
|
||||
)
|
||||
})
|
||||
|
||||
it("lists all orders with a fulfillment status = fulfilled and payment status = captured", async () => {
|
||||
const api = useApi()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user