46 lines
1.3 KiB
TypeScript
46 lines
1.3 KiB
TypeScript
import type { AssertableState } from "../utils/assertable-state";
|
|
import type { TestDefinition } from "../test-definition";
|
|
|
|
export const offlineDeleteVsRemoteUpdateTest: TestDefinition = {
|
|
description:
|
|
"Client 0 deletes A.md offline while client 1 updates it. Both clients must converge.",
|
|
clients: 2,
|
|
steps: [
|
|
{
|
|
type: "create",
|
|
client: 0,
|
|
path: "A.md",
|
|
content: "original content"
|
|
},
|
|
{ type: "enable-sync", client: 0 },
|
|
{ type: "enable-sync", client: 1 },
|
|
{ type: "barrier" },
|
|
{
|
|
type: "assert-consistent",
|
|
verify: (s: AssertableState): void => {
|
|
s.assertContent("A.md", "original content");
|
|
}
|
|
},
|
|
|
|
{ type: "disable-sync", client: 0 },
|
|
{ type: "delete", client: 0, path: "A.md" },
|
|
|
|
{
|
|
type: "update",
|
|
client: 1,
|
|
path: "A.md",
|
|
content: "important update by client 1"
|
|
},
|
|
{ type: "sync", client: 1 },
|
|
|
|
{ type: "enable-sync", client: 0 },
|
|
{ type: "barrier" },
|
|
|
|
{
|
|
type: "assert-consistent",
|
|
verify: (s: AssertableState): void => {
|
|
s.assertFileCount(0);
|
|
}
|
|
}
|
|
]
|
|
};
|