43 lines
1.7 KiB
TypeScript
43 lines
1.7 KiB
TypeScript
import type { TestDefinition } from "../test-definition";
|
|
|
|
export const mcMultiDeleteOfflineRenameTest: TestDefinition = {
|
|
description:
|
|
"Client 0 creates 5 files. Client 1 deletes 2 while Client 0 (offline) " +
|
|
"renames one of the deleted files. Both must converge.",
|
|
clients: 2,
|
|
steps: [
|
|
{ type: "create", client: 0, path: "file-1.md", content: "content-1" },
|
|
{ type: "create", client: 0, path: "file-2.md", content: "content-2" },
|
|
{ type: "create", client: 0, path: "file-3.md", content: "content-3" },
|
|
{ type: "create", client: 0, path: "file-4.md", content: "content-4" },
|
|
{ type: "create", client: 0, path: "file-5.md", content: "content-5" },
|
|
{ type: "enable-sync", client: 0 },
|
|
{ type: "enable-sync", client: 1 },
|
|
{ type: "sync" },
|
|
{ type: "barrier" },
|
|
|
|
{ type: "disable-sync", client: 0 },
|
|
|
|
{ type: "delete", client: 1, path: "file-2.md" },
|
|
{ type: "delete", client: 1, path: "file-4.md" },
|
|
{ type: "sync", client: 1 },
|
|
|
|
{ type: "rename", client: 0, oldPath: "file-2.md", newPath: "renamed.md" },
|
|
|
|
{ type: "enable-sync", client: 0 },
|
|
{ type: "sync" },
|
|
{ type: "barrier" },
|
|
|
|
{
|
|
type: "assert-consistent",
|
|
verify: (s) => {
|
|
s.assertFileExists("file-1.md")
|
|
.assertFileExists("file-3.md")
|
|
.assertFileExists("file-5.md")
|
|
.assertFileNotExists("file-2.md")
|
|
.assertFileNotExists("file-4.md");
|
|
s.ifFileExists("renamed.md", (s) => s.assertContent("renamed.md", "content-2"));
|
|
}
|
|
}
|
|
]
|
|
};
|