A2: Compare with Disk as a UI command (editor.compareWithDisk)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
danny 2026-11-08 12:26:51 +01:00
parent d2344bf216
commit 59313f3f62
6 changed files with 47 additions and 4 deletions

View file

@ -155,6 +155,15 @@ describe("files changed on disk", () => {
expect(calls.find((c) => c.command === "file.readDisk")?.params).toEqual({ path: "src/a.php" });
});
it("compares any file with the disk through editor.compareWithDisk", async () => {
await mountWithFile();
await useCommandsStore(pinia).execute("editor.compareWithDisk", {});
await flushPromises();
expect(useDiffStore(pinia).activeTab?.key).toBe("disk:src/a.php");
const disk = useDiskConflictsStore(pinia);
await expect(disk.compareCommand({ path: 1 })).rejects.toThrow("Compare with Disk takes");
});
it("asks once more when a kept buffer is saved over the newer file", async () => {
const area = await mountWithFile();
const editor = useEditorStore(pinia);