import type { AssertableState } from "../utils/assertable-state"; import type { TestDefinition } from "../test-definition"; export const renameRoundtripTest: TestDefinition = { description: "Client 0 creates A.md, renames it to B.md, then renames it back to A.md. After each step both clients sync. Both should end with only A.md at the original path.", clients: 2, steps: [ { type: "create", client: 0, path: "A.md", content: "original" }, { type: "enable-sync", client: 0 }, { type: "enable-sync", client: 1 }, { type: "barrier" }, { type: "assert-consistent", verify: (s: AssertableState): void => { s.assertContent("A.md", "original"); } }, { type: "rename", client: 0, oldPath: "A.md", newPath: "B.md" }, { type: "barrier" }, { type: "assert-consistent", verify: (s: AssertableState): void => { s.assertFileNotExists("A.md").assertContent("B.md", "original"); } }, { type: "rename", client: 0, oldPath: "B.md", newPath: "A.md" }, { type: "barrier" }, { type: "assert-consistent", verify: (s: AssertableState): void => { s.assertFileNotExists("B.md").assertContent("A.md", "original"); } } ] };