fix: Addresses breaking change from library class-transformer (#835)
Co-authored-by: Philip Korsholm <philip.korsholm@hotmail.com>
This commit is contained in:
committed by
GitHub
parent
59761163c2
commit
f387b4919f
@@ -413,32 +413,34 @@ describe("/admin/orders", () => {
|
||||
it("creates a claim on order with discount", async () => {
|
||||
const api = useApi()
|
||||
|
||||
const response = await api.post(
|
||||
"/admin/orders/discount-order/claims",
|
||||
{
|
||||
type: "refund",
|
||||
claim_items: [
|
||||
{
|
||||
item_id: "test-item",
|
||||
quantity: 1,
|
||||
reason: "production_failure",
|
||||
tags: ["fluff"],
|
||||
images: ["https://test.image.com"],
|
||||
},
|
||||
],
|
||||
additional_items: [
|
||||
{
|
||||
variant_id: "test-variant",
|
||||
quantity: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
headers: {
|
||||
authorization: "Bearer test_token",
|
||||
const response = await api
|
||||
.post(
|
||||
"/admin/orders/discount-order/claims",
|
||||
{
|
||||
type: "refund",
|
||||
claim_items: [
|
||||
{
|
||||
item_id: "test-item-1",
|
||||
quantity: 1,
|
||||
reason: "production_failure",
|
||||
tags: ["fluff"],
|
||||
images: ["https://test.image.com"],
|
||||
},
|
||||
],
|
||||
additional_items: [
|
||||
{
|
||||
variant_id: "test-variant",
|
||||
quantity: 1,
|
||||
},
|
||||
],
|
||||
},
|
||||
}
|
||||
)
|
||||
{
|
||||
headers: {
|
||||
authorization: "Bearer test_token",
|
||||
},
|
||||
}
|
||||
)
|
||||
.catch((err) => console.log(err))
|
||||
expect(response.status).toEqual(200)
|
||||
})
|
||||
|
||||
@@ -1226,6 +1228,9 @@ describe("/admin/orders", () => {
|
||||
expect.objectContaining({
|
||||
id: "test-order-w-r",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "discount-order",
|
||||
}),
|
||||
])
|
||||
})
|
||||
|
||||
@@ -1245,6 +1250,9 @@ describe("/admin/orders", () => {
|
||||
expect.objectContaining({
|
||||
id: "test-order",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "discount-order",
|
||||
}),
|
||||
])
|
||||
})
|
||||
|
||||
@@ -1299,12 +1307,16 @@ describe("/admin/orders", () => {
|
||||
})
|
||||
|
||||
expect(response.status).toEqual(200)
|
||||
expect(response.data.count).toEqual(1)
|
||||
expect(response.data.count).toEqual(2)
|
||||
expect(response.data.orders).toEqual([
|
||||
expect.objectContaining({
|
||||
id: "test-order",
|
||||
shipping_address: expect.objectContaining({ first_name: "lebron" }),
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "discount-order",
|
||||
shipping_address: expect.objectContaining({ first_name: "lebron" }),
|
||||
}),
|
||||
])
|
||||
})
|
||||
|
||||
@@ -1338,6 +1350,9 @@ describe("/admin/orders", () => {
|
||||
expect.objectContaining({
|
||||
id: "test-order-w-r",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "discount-order",
|
||||
}),
|
||||
])
|
||||
})
|
||||
|
||||
@@ -1387,6 +1402,9 @@ describe("/admin/orders", () => {
|
||||
expect.objectContaining({
|
||||
id: "test-order-w-r",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "discount-order",
|
||||
}),
|
||||
])
|
||||
})
|
||||
|
||||
@@ -1436,6 +1454,9 @@ describe("/admin/orders", () => {
|
||||
expect.objectContaining({
|
||||
id: "test-order-w-r",
|
||||
}),
|
||||
expect.objectContaining({
|
||||
id: "discount-order",
|
||||
}),
|
||||
])
|
||||
})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user