Download __tests__/components/shared/buttons/back-nav-button.test.tsx from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 565 Bytes
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/__tests__/components/shared/buttons/back-nav-button.test.tsx
- Command line
-
hf download hf://SaylorTwift/openhands/__tests__/components/shared/buttons/back-nav-button.test.tsx
-
curl -L -o back-nav-button.test.tsx https://huggingface.co/SaylorTwift/openhands/resolve/main/__tests__/components/shared/buttons/back-nav-button.test.tsx
565 Bytes
| import { render, screen, fireEvent } from "@testing-library/react"; | |
| import { describe, it, expect, vi } from "vitest"; | |
| import { BackNavButton } from "#/components/shared/buttons/back-nav-button"; | |
| describe("BackNavButton", () => { | |
| it("renders a back button that fires onClick when clicked", () => { | |
| const onClick = vi.fn(); | |
| render( | |
| <BackNavButton onClick={onClick} testId="back-button"> | |
| <span /> | |
| </BackNavButton>, | |
| ); | |
| fireEvent.click(screen.getByTestId("back-button")); | |
| expect(onClick).toHaveBeenCalledTimes(1); | |
| }); | |
| }); | |