Untitled
unknown
plain_text
7 months ago
743 B
4
Indexable
import { render } from "@testing-library/react"
import { useAuth } from "@contexts/AuthContext"
import { useNavigate } from "react-router-dom"
import CustomerSelection from ".."
jest.mock("@contexts/AuthContext", () => ({ useAuth: jest.fn() }))
jest.mock("react-router-dom", () => ({ useNavigate: jest.fn() }))
describe("CustomerSelection", () => {
let loginMock: jest.Mock, navigateMock: jest.Mock
beforeEach(() => {
loginMock = jest.fn()
navigateMock = jest.fn()
;(useAuth as jest.Mock).mockReturnValue({ login: loginMock })
;(useNavigate as jest.Mock).mockReturnValue(navigateMock)
})
it("deve renderizar em tela", () => {
render(<CustomerSelection />)
expect(1).toBe(1)
})
})
Editor is loading...
Leave a Comment