Update tests

This commit is contained in:
Andras Schmelczer 2026-04-06 13:01:34 +01:00
commit 0e3e5a99cd

View file

@ -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"
),
}
]
};