feat(medusa, medusa-js, medusa-react): Add endpoint to retrieve product tags from the storefront (#3051)

This commit is contained in:
Kasper Fabricius Kristensen
2023-01-18 10:47:15 +01:00
committed by GitHub
parent ab580066ae
commit 150696de99
15 changed files with 491 additions and 21 deletions
@@ -0,0 +1,19 @@
import { renderHook } from "@testing-library/react-hooks"
import { fixtures } from "../../../../mocks/data/index"
import { useProductTags } from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useProductTags hook", () => {
test("gets a list of products", async () => {
const { result, waitFor } = renderHook(() => useProductTags(), {
wrapper: createWrapper(),
})
await waitFor(() => result.current.isSuccess)
expect(result.current.response.status).toEqual(200)
expect(result.current.product_tags).toEqual(
fixtures.list("product_tag", 10)
)
})
})