Skip to content

Commit 9132728

Browse files
committed
test(web): align diff type-change tests with current main
1 parent 79c91df commit 9132728

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

‎apps/web/src/components/diffs/DiffFileTree.test.tsx‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ describe("diff tree file activation", () => {
118118
it("mounts a file-to-symlink type change as one tree row", async () => {
119119
// Git carries a type change as a deletion and an addition of the same path.
120120
const typeChange = diffFileTreeEntries([
121-
{ type: "deleted", name: "b/AGENTS.md", prevName: "a/AGENTS.md" } as FileDiffMetadata,
122-
{ type: "new", name: "b/AGENTS.md", prevName: "a/AGENTS.md" } as FileDiffMetadata,
123-
{ type: "change", name: "b/CLAUDE.md", prevName: "a/CLAUDE.md" } as FileDiffMetadata,
121+
{ type: "deleted", name: "AGENTS.md", prevName: "AGENTS.md" } as FileDiffMetadata,
122+
{ type: "new", name: "AGENTS.md", prevName: "AGENTS.md" } as FileDiffMetadata,
123+
{ type: "change", name: "CLAUDE.md", prevName: "CLAUDE.md" } as FileDiffMetadata,
124124
]);
125125
await mount({ files: [...typeChange] });
126126

‎apps/web/src/lib/diffRendering.test.ts‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@ describe("buildPatchCacheKey", () => {
3535

3636
describe("getRenderablePatch", () => {
3737
it.each([
38-
["a/example.ts", "a/example.ts"],
39-
["b/example.ts", "b/example.ts"],
40-
["a/before.ts", "b/after.ts"],
41-
])("preserves repository paths from %s to %s", (previousPath, path) => {
38+
["a/example.ts", "a/example.ts", "change"],
39+
["b/example.ts", "b/example.ts", "change"],
40+
["a/before.ts", "b/after.ts", "rename-changed"],
41+
])("preserves repository paths from %s to %s", (previousPath, path, type) => {
4242
const parsed = getRenderablePatch(
4343
[
4444
`diff --git a/${previousPath} b/${path}`,
@@ -59,7 +59,7 @@ describe("getRenderablePatch", () => {
5959
if (!file) return;
6060
expect(resolveFileDiffPath(file)).toBe(path);
6161
expect(resolveFileDiffPreviousPath(file)).toBe(previousPath);
62-
expect(buildFileDiffIdentityKey(file)).toBe(`${previousPath}\0${path}`);
62+
expect(buildFileDiffIdentityKey(file)).toBe(`${previousPath}\0${path}\0${type}`);
6363
});
6464

6565
it("compacts partial hunk render offsets for virtualized review diffs", () => {

0 commit comments

Comments
 (0)