Download __tests__/initial-query.test.tsx from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 808 Bytes
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/__tests__/initial-query.test.tsx
- Command line
-
hf download hf://SaylorTwift/openhands/__tests__/initial-query.test.tsx
-
curl -L -o initial-query.test.tsx https://huggingface.co/SaylorTwift/openhands/resolve/main/__tests__/initial-query.test.tsx
808 Bytes
| import { describe, it, expect, beforeEach } from "vitest"; | |
| import { useInitialQueryStore } from "../src/stores/initial-query-store"; | |
| describe("Initial Query Behavior", () => { | |
| beforeEach(() => { | |
| // Reset the store before each test | |
| useInitialQueryStore.getState().reset(); | |
| }); | |
| it("should clear initial query when clearInitialPrompt is called", () => { | |
| const { setInitialPrompt, clearInitialPrompt, initialPrompt } = | |
| useInitialQueryStore.getState(); | |
| // Set up initial query in the store | |
| setInitialPrompt("test query"); | |
| expect(useInitialQueryStore.getState().initialPrompt).toBe("test query"); | |
| // Clear the initial query | |
| clearInitialPrompt(); | |
| // Verify initial query is cleared | |
| expect(useInitialQueryStore.getState().initialPrompt).toBeNull(); | |
| }); | |
| }); | |