feat(medusa, medusa-js, medusa-react): Implement Sales Channel retrieval (#1793)

This commit is contained in:
Adrien de Peretti
2022-07-06 12:17:26 +02:00
committed by GitHub
parent e115518dda
commit 263a661031
26 changed files with 511 additions and 34 deletions
@@ -0,0 +1,20 @@
import {
useAdminSalesChannel,
} from "../../../../src"
import { renderHook } from "@testing-library/react-hooks"
import { fixtures } from "../../../../mocks/data"
import { createWrapper } from "../../../utils"
describe("useAdminSalesChannel hook", () => {
test("returns a product", async () => {
const salesChannel = fixtures.get("sales_channel")
const { result, waitFor } = renderHook(() => useAdminSalesChannel(salesChannel.id), {
wrapper: createWrapper(),
})
await waitFor(() => result.current.isSuccess)
expect(result.current.response.status).toEqual(200)
expect(result.current.sales_channel).toEqual(salesChannel)
})
})