New deterministic-tests workspace: scripted multi-client harness against a real server (~110 scenario tests, server-control, managed-websocket, test-runner). Updates to existing workspaces: obsidian-plugin (settings, cursors, plugin entrypoint), local-client-cli (args, cli, file-watcher, node-filesystem, path-utils + tests), test-client (mock-agent/client, cli, error tracker). Bumps frontend root package.json/lock and adds eslint config tweaks.
49 lines
1.5 KiB
TypeScript
49 lines
1.5 KiB
TypeScript
import type { AssertableState } from "../utils/assertable-state";
|
|
import type { TestDefinition } from "../test-definition";
|
|
|
|
export const concurrentRenameAndCreateAtTargetTest: TestDefinition = {
|
|
description:
|
|
"One client renames X to Y while another creates a new file at Y, " +
|
|
"both offline. After syncing, Y should contain merged content from " +
|
|
"both the renamed file and the newly created file.",
|
|
clients: 2,
|
|
steps: [
|
|
{
|
|
type: "create",
|
|
client: 0,
|
|
path: "X.md",
|
|
content: "original file X"
|
|
},
|
|
{ type: "enable-sync", client: 0 },
|
|
{ type: "enable-sync", client: 1 },
|
|
{ type: "barrier" },
|
|
|
|
{ type: "disable-sync", client: 0 },
|
|
{ type: "disable-sync", client: 1 },
|
|
|
|
{ type: "rename", client: 0, oldPath: "X.md", newPath: "Y.md" },
|
|
|
|
{
|
|
type: "create",
|
|
client: 1,
|
|
path: "Y.md",
|
|
content: "brand new Y content"
|
|
},
|
|
|
|
{ type: "enable-sync", client: 1 },
|
|
{ type: "sync", client: 1 },
|
|
|
|
{ type: "enable-sync", client: 0 },
|
|
{ type: "barrier" },
|
|
|
|
{
|
|
type: "assert-consistent",
|
|
verify: (state: AssertableState): void => {
|
|
state
|
|
.assertFileCount(2)
|
|
.assertContains("Y (1).md", "original file X")
|
|
.assertContains("Y.md", "brand new Y content");
|
|
}
|
|
}
|
|
]
|
|
};
|