feat(medusa,medusa-react): PaymentCollection support (#2659)

* chore: medusa react, order edit complete fix and single payment session
This commit is contained in:
Carlos R. L. Rodrigues
2022-12-07 12:39:35 -03:00
committed by GitHub
parent 42d9c7222b
commit 15c667fbd3
54 changed files with 2001 additions and 261 deletions
@@ -0,0 +1,21 @@
import { renderHook } from "@testing-library/react-hooks"
import { fixtures } from "../../../../mocks/data"
import { createWrapper } from "../../../utils"
import { useAdminPaymentCollection } from "../../../../src/hooks/admin/payment-collections"
describe("useAdminPaymentCollection hook", () => {
test("returns a payment collection", async () => {
const payment_collection = fixtures.get("payment_collection")
const { result, waitFor } = renderHook(
() => useAdminPaymentCollection(payment_collection.id),
{
wrapper: createWrapper(),
}
)
await waitFor(() => result.current.isSuccess)
expect(result.current.response.status).toEqual(200)
expect(result.current.payment_collection).toEqual(payment_collection)
})
})