Update tests
This commit is contained in:
parent
64ca5a82ef
commit
0e3e5a99cd
1 changed files with 180 additions and 87 deletions
|
|
@ -2,26 +2,18 @@ import type { TestDefinition } from "../test-definition";
|
|||
|
||||
export const localEditLostDuringCreateMergeTest: TestDefinition = {
|
||||
description:
|
||||
"Client 1 creates doc.md. Client 0 creates the same file offline, then connects with the server paused. " +
|
||||
"Client 0 edits the file while the create is stalled. After resume, both clients' content must be merged.",
|
||||
"Both clients create doc.md with different content while offline. " +
|
||||
"Client 0 also edits the file before syncing. After both connect, " +
|
||||
"the merged result should contain content from both clients.",
|
||||
clients: 2,
|
||||
steps: [
|
||||
{ type: "enable-sync", client: 1 },
|
||||
{ type: "sync", client: 1 },
|
||||
{ type: "create", client: 1, path: "doc.md", content: "from-client-1" },
|
||||
{ type: "sync", client: 1 },
|
||||
|
||||
{
|
||||
type: "create",
|
||||
client: 0,
|
||||
path: "doc.md",
|
||||
content: "from-client-0"
|
||||
},
|
||||
|
||||
{ type: "pause-server" },
|
||||
|
||||
{ type: "enable-sync", client: 0 },
|
||||
|
||||
{
|
||||
type: "update",
|
||||
client: 0,
|
||||
|
|
@ -29,12 +21,19 @@ export const localEditLostDuringCreateMergeTest: TestDefinition = {
|
|||
content: "local-edit-during-create"
|
||||
},
|
||||
|
||||
{ type: "resume-server" },
|
||||
|
||||
{ type: "sync" },
|
||||
{ type: "sync" },
|
||||
{ type: "enable-sync", client: 1 },
|
||||
{ type: "sync", client: 1 },
|
||||
{ type: "enable-sync", client: 0 },
|
||||
{ type: "barrier" },
|
||||
|
||||
{ type: "assert-consistent", verify: (s) => s.assertFileCount(1).assertContains("doc.md", "from-client-1", "local-edit-during-create") }
|
||||
{
|
||||
type: "assert-consistent",
|
||||
verify: (s) =>
|
||||
s.assertFileCount(1).assertContains(
|
||||
"doc.md",
|
||||
"from-client-1",
|
||||
"local-edit-during-create"
|
||||
),
|
||||
}
|
||||
]
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue