feat(medusa, medusa-js, medusa-react): Add endpoint to retrieve product tags from the storefront (#3051)
This commit is contained in:
@@ -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)
|
||||
)
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user