Files
medusa-store/packages/medusa-react/test/hooks/admin/notifications/queries.test.ts
2023-03-03 10:09:16 +01:00

19 lines
670 B
TypeScript

import { renderHook } from "@testing-library/react-hooks/dom"
import { fixtures } from "../../../../mocks/data"
import { useAdminNotifications } from "../../../../src"
import { createWrapper } from "../../../utils"
describe("useAdminNotifications hook", () => {
test("returns a list of notifications", async () => {
const notifications = fixtures.list("notification")
const { result, waitFor } = renderHook(() => useAdminNotifications(), {
wrapper: createWrapper(),
})
await waitFor(() => result.current.isSuccess)
expect(result.current.response.status).toEqual(200)
expect(result.current.notifications).toEqual(notifications)
})
})