feat: restore current project copies and choose text mapping
This commit is contained in:
@@ -72,6 +72,15 @@ describe("Velum-Projektstände", () => {
|
||||
expect(await fs.readFile(join(copyPath, "Unterordner", "PERSON_01.txt"), "utf8")).toBe("PERSON_01");
|
||||
expect(await fs.readdir(copyPath)).toEqual(["Unterordner"]);
|
||||
expect(await fs.readFile(join(created.directory, "run.json"), "utf8")).toContain("Max Mustermann");
|
||||
await fs.writeFile(join(copyPath, "Antwort.txt"), "PERSON_01 antwortet");
|
||||
const current = await project.scanRestorableCopyFiles(created.run, created.directory);
|
||||
expect(current.root).toBe(copyPath);
|
||||
expect(current.files.map((file) => file.relPath)).toEqual(["Antwort.txt", "Unterordner/PERSON_01.txt"]);
|
||||
const history = await project.scanRestorableCopyFiles(created.run, created.directory, false);
|
||||
expect(history.root).toBe(join(created.directory, "files"));
|
||||
expect(history.files.map((file) => file.relPath)).toEqual(["Unterordner/PERSON_01.txt"]);
|
||||
expect(project.restoreTextWithCount("PERSON_01 antwortet", created.run.mapping))
|
||||
.toEqual({ text: "Max Mustermann antwortet", replacements: 1 });
|
||||
await expect(project.publishProjectCopies(created.run, created.directory)).rejects.toThrow("bereits vorhanden");
|
||||
expect((await project.listRuns(source, support))[0].run.copyPath).toBe(copyPath);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user