vault-link/frontend/deterministic-tests/src/tests/offline-create-same-path-mergeable.test.ts
Andras Schmelczer 20e1c3f22d
Some checks failed
Check / build (pull_request) Has been cancelled
E2E tests / build (pull_request) Has been cancelled
Publish CLI / publish-docker (pull_request) Has been cancelled
Publish server Docker image / publish-docker (pull_request) Has been cancelled
Improve tests
2026-05-09 09:06:12 +01:00

41 lines
1.3 KiB
TypeScript

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