Spaces:
Paused
Paused
Download console/src/features/files-workspace/profileFileSelection.test.ts from mysticaldragon/HF: direct link, hf CLI and curl.
- Browser
- Download file 1.05 kB
-
https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/features/files-workspace/profileFileSelection.test.ts
- Command line
-
hf download hf://spaces/mysticaldragon/HF/console/src/features/files-workspace/profileFileSelection.test.ts
-
curl -L -o profileFileSelection.test.ts https://huggingface.co/spaces/mysticaldragon/HF/resolve/main/console/src/features/files-workspace/profileFileSelection.test.ts
1.05 kB
| import { describe, expect, it } from "vitest"; | |
| import { selectProfileFiles } from "./profileFileSelection"; | |
| import type { DirectoryEntry } from "./types"; | |
| const file = (path: string): DirectoryEntry => ({ | |
| name: path, | |
| path, | |
| kind: "file", | |
| size: 0, | |
| modified_at: "2026-01-01T00:00:00Z", | |
| preview_kind: "text", | |
| }); | |
| describe("selectProfileFiles", () => { | |
| it("keeps the profile list limited to defaults and enabled custom files", () => { | |
| const files = [ | |
| file("notes.md"), | |
| file("SOUL.md"), | |
| file("custom-prompt.md"), | |
| file("AGENTS.md"), | |
| ]; | |
| expect(selectProfileFiles(files, ["custom-prompt.md"])).toEqual([ | |
| file("custom-prompt.md"), | |
| file("AGENTS.md"), | |
| file("SOUL.md"), | |
| ]); | |
| }); | |
| it("removes a disabled custom file without hiding workspace candidates", () => { | |
| const files = [file("AGENTS.md"), file("custom-prompt.md")]; | |
| expect(selectProfileFiles(files, [])).toEqual([file("AGENTS.md")]); | |
| expect(files).toEqual([file("AGENTS.md"), file("custom-prompt.md")]); | |
| }); | |
| }); | |