Skip to content

Commit e7de164

Browse files
test(web): trim Windows path display regression test
AI-assisted; verified with the tests and tools listed above. Co-Authored-By: Claude Opus 5.5 <[email protected]>
1 parent 0aaa30c commit e7de164

1 file changed

Lines changed: 6 additions & 19 deletions

File tree

‎apps/web/src/filePathDisplay.test.ts‎

Lines changed: 6 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,14 @@ import { describe, expect, it } from "vite-plus/test";
33
import { formatWorkspaceRelativePath } from "./filePathDisplay";
44

55
describe("formatWorkspaceRelativePath", () => {
6-
it("leaves Windows absolute paths outside the workspace alone", () => {
6+
it("labels only relative paths, not Windows paths outside the workspace", () => {
7+
const workspaceRoot = "C:\\Users\\mike\\dev-stuff\\t3code";
78
expect(
8-
formatWorkspaceRelativePath(
9-
"C:\\Users\\mike\\.claude\\settings.json:3",
10-
"C:\\Users\\mike\\dev-stuff\\t3code",
11-
),
9+
formatWorkspaceRelativePath("C:\\Users\\mike\\.claude\\settings.json:3", workspaceRoot),
1210
).toBe("C:/Users/mike/.claude/settings.json:3");
13-
expect(
14-
formatWorkspaceRelativePath("D:/data/report.csv", "C:/Users/mike/dev-stuff/t3code"),
15-
).toBe("D:/data/report.csv");
16-
});
17-
18-
it("still labels relative and in-workspace paths with the workspace name", () => {
19-
expect(formatWorkspaceRelativePath("src/app.ts", "C:/Users/mike/dev-stuff/t3code")).toBe(
20-
"t3code/src/app.ts",
11+
expect(formatWorkspaceRelativePath("D:/data/report.csv", workspaceRoot)).toBe(
12+
"D:/data/report.csv",
2113
);
22-
expect(
23-
formatWorkspaceRelativePath(
24-
"c:\\users\\mike\\dev-stuff\\t3code\\src\\app.ts:7",
25-
"C:\\Users\\mike\\dev-stuff\\t3code",
26-
),
27-
).toBe("t3code/src/app.ts:7");
14+
expect(formatWorkspaceRelativePath("src/app.ts", workspaceRoot)).toBe("t3code/src/app.ts");
2815
});
2916
});

0 commit comments

Comments
 (0)