The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 03:37 UTC
| 1 | import { describe, expect, it } from "vite-plus/test"; |
| 2 | |
| 3 | import { formatWorkspaceRelativePath } from "./filePathDisplay"; |
| 4 | |
| 5 | describe("formatWorkspaceRelativePath", () => { |
| 6 | it("labels only relative paths, not Windows paths outside the workspace", () => { |
| 7 | const workspaceRoot = "C:\\Users\\mike\\dev-stuff\\t3code"; |
| 8 | expect( |
| 9 | formatWorkspaceRelativePath("C:\\Users\\mike\\.claude\\settings.json:3", workspaceRoot), |
| 10 | ).toBe("C:/Users/mike/.claude/settings.json:3"); |
| 11 | expect(formatWorkspaceRelativePath("D:/data/report.csv", workspaceRoot)).toBe( |
| 12 | "D:/data/report.csv", |
| 13 | ); |
| 14 | expect(formatWorkspaceRelativePath("src/app.ts", workspaceRoot)).toBe("t3code/src/app.ts"); |
| 15 | }); |
| 16 | |
| 17 | it("keeps home paths as written instead of labelling them as workspace paths", () => { |
| 18 | expect(formatWorkspaceRelativePath("~/.claude/CLAUDE.md", "/workspace/t3code")).toBe( |
| 19 | "~/.claude/CLAUDE.md", |
| 20 | ); |
| 21 | expect(formatWorkspaceRelativePath("~\\.claude\\CLAUDE.md:3", "C:\\dev\\t3code")).toBe( |
| 22 | "~/.claude/CLAUDE.md:3", |
| 23 | ); |
| 24 | }); |
| 25 | }); |