Spaces:
Configuration error
Configuration error
Download frontend/__tests__/components/features/sidebar/sidebar.test.tsx from flyingdarkdev/README: direct link, hf CLI and curl.
- Browser
- Download file 923 Bytes
-
https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/__tests__/components/features/sidebar/sidebar.test.tsx
- Command line
-
hf download hf://spaces/flyingdarkdev/README/frontend/__tests__/components/features/sidebar/sidebar.test.tsx
-
curl -L -o sidebar.test.tsx https://huggingface.co/spaces/flyingdarkdev/README/resolve/main/frontend/__tests__/components/features/sidebar/sidebar.test.tsx
923 Bytes
| import { afterEach, describe, expect, it, vi } from "vitest"; | |
| import { renderWithProviders } from "test-utils"; | |
| import { createRoutesStub } from "react-router"; | |
| import { Sidebar } from "#/components/features/sidebar/sidebar"; | |
| import OpenHands from "#/api/open-hands"; | |
| // These tests will now fail because the conversation panel is rendered through a portal | |
| // and technically not a child of the Sidebar component. | |
| const RouterStub = createRoutesStub([ | |
| { | |
| path: "/conversation/:conversationId", | |
| Component: () => <Sidebar />, | |
| }, | |
| ]); | |
| const renderSidebar = () => | |
| renderWithProviders(<RouterStub initialEntries={["/conversation/123"]} />); | |
| describe("Sidebar", () => { | |
| const getSettingsSpy = vi.spyOn(OpenHands, "getSettings"); | |
| afterEach(() => { | |
| vi.clearAllMocks(); | |
| }); | |
| it("should fetch settings data on mount", () => { | |
| renderSidebar(); | |
| expect(getSettingsSpy).toHaveBeenCalled(); | |
| }); | |
| }); | |