Download __tests__/components/features/settings/settings-nav-header.test.tsx from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 932 Bytes
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/__tests__/components/features/settings/settings-nav-header.test.tsx
- Command line
-
hf download hf://SaylorTwift/openhands/__tests__/components/features/settings/settings-nav-header.test.tsx
-
curl -L -o settings-nav-header.test.tsx https://huggingface.co/SaylorTwift/openhands/resolve/main/__tests__/components/features/settings/settings-nav-header.test.tsx
932 Bytes
| import { render, screen } from "@testing-library/react"; | |
| import { describe, it, expect } from "vitest"; | |
| import { SettingsNavHeader } from "#/components/features/settings/settings-nav-header"; | |
| import { I18nKey } from "#/i18n/declaration"; | |
| describe("SettingsNavHeader", () => { | |
| it("should render the translated header text", () => { | |
| render(<SettingsNavHeader text={I18nKey.SETTINGS$PERSONAL_SETTINGS_HEADER} />); | |
| expect( | |
| screen.getByText("SETTINGS$PERSONAL_SETTINGS_HEADER"), | |
| ).toBeInTheDocument(); | |
| }); | |
| // Prop-passthrough contract: consumer-supplied className must land on the | |
| // element. | |
| it("should accept custom className", () => { | |
| const { container } = render( | |
| <SettingsNavHeader | |
| text={I18nKey.SETTINGS$PERSONAL_SETTINGS_HEADER} | |
| className="custom-class" | |
| />, | |
| ); | |
| const wrapper = container.firstChild; | |
| expect(wrapper).toHaveClass("custom-class"); | |
| }); | |
| }); | |