Files
medusa-store/packages/medusa-react/test/hooks/admin/payments/queries.test.ts
Carlos R. L. Rodrigues 15c667fbd3 feat(medusa,medusa-react): PaymentCollection support (#2659)
* chore: medusa react, order edit complete fix and single payment session
2022-12-07 12:39:35 -03:00

19 lines
652 B
TypeScript

import { renderHook } from "@testing-library/react-hooks"
import { fixtures } from "../../../../mocks/data"
import { createWrapper } from "../../../utils"
import { useAdminPayment } from "../../../../src/hooks/admin/payments"
describe("useAdminPayment hook", () => {
test("returns a payment collection", async () => {
const payment = fixtures.get("payment")
const { result, waitFor } = renderHook(() => useAdminPayment(payment.id), {
wrapper: createWrapper(),
})
await waitFor(() => result.current.isSuccess)
expect(result.current.response.status).toEqual(200)
expect(result.current.payment).toEqual(payment)
})
})