Untitled
Anonymous
plain_text
03/24/2025 7:08 PM
992 B
16
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