feat(medusa): Support OrderEdit removal (#2204)

This commit is contained in:
Philip Korsholm
2022-09-16 08:39:40 +02:00
committed by GitHub
parent 6225aa57b8
commit 09627c01d3
13 changed files with 374 additions and 5 deletions
@@ -0,0 +1,26 @@
import { useAdminDeleteOrderEdit } from "../../../../src/"
import { renderHook } from "@testing-library/react-hooks"
import { fixtures } from "../../../../mocks/data"
import { createWrapper } from "../../../utils"
describe("useAdminDelete hook", () => {
test("Deletes an order edit", async () => {
const id = "oe_1"
const { result, waitFor } = renderHook(() => useAdminDeleteOrderEdit(id), {
wrapper: createWrapper(),
})
result.current.mutate()
await waitFor(() => result.current.isSuccess)
expect(result.current.data.response.status).toEqual(200)
expect(result.current.data).toEqual(
expect.objectContaining({
id,
object: "order_edit",
deleted: true,
})
)
})
})