Improve tests
This commit is contained in:
parent
a33e4bbcb9
commit
20e1c3f22d
28 changed files with 115 additions and 56 deletions
|
|
@ -0,0 +1,41 @@
|
|||
import type { AssertableState } from "../utils/assertable-state";
|
||||
import type { TestDefinition } from "../test-definition";
|
||||
|
||||
export const offlineCreateSamePathMergeableTest: TestDefinition = {
|
||||
description:
|
||||
"Both clients create a file at the same path while offline with different text content. " +
|
||||
"After both sync, both clients must converge to a merged result containing both contributions.",
|
||||
clients: 2,
|
||||
steps: [
|
||||
{
|
||||
type: "create",
|
||||
client: 0,
|
||||
path: "notes.md",
|
||||
content: "alpha wrote this line"
|
||||
},
|
||||
{
|
||||
type: "create",
|
||||
client: 1,
|
||||
path: "notes.md",
|
||||
content: "beta wrote this different line"
|
||||
},
|
||||
|
||||
{ type: "enable-sync", client: 0 },
|
||||
{ type: "sync", client: 0 },
|
||||
{ type: "enable-sync", client: 1 },
|
||||
{ type: "barrier" },
|
||||
|
||||
{
|
||||
type: "assert-consistent",
|
||||
verify: (s: AssertableState): void => {
|
||||
s.assertFileCount(1)
|
||||
.assertFileExists("notes.md")
|
||||
.assertContains(
|
||||
"notes.md",
|
||||
"alpha wrote this line",
|
||||
"beta wrote this different line"
|
||||
);
|
||||
}
|
||||
}
|
||||
]
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue