Preserve nested CRDT recovery and serialize compound editor submissions
This commit is contained in:
@@ -9,10 +9,20 @@ const source = { repository: "https://example.test/change.git", commit: "a".repe
|
||||
test("compound captured changes survive planning, transport lowering and typed edit ports", async () => {
|
||||
const plan = await compoundCrdtPlan();
|
||||
const kernel = compileKernelProgram(plan) as {
|
||||
operations: { operation: string; input: { fields: { change: { kind: string } } } }[];
|
||||
operations: {
|
||||
operation: string;
|
||||
inputChanges?: (string | null)[][];
|
||||
input: { fields: { change: { kind: string } } };
|
||||
}[];
|
||||
};
|
||||
const operation = kernel.operations.find((op) => op.operation === "compound:update:call")!;
|
||||
assert.equal(operation.input.fields.change.kind, "record");
|
||||
const paths = kernel.operations as unknown as { operation: string; inputChanges?: (string | null)[][] }[];
|
||||
assert.deepEqual(paths.find((op) => op.operation === "compound:update:call")!.inputChanges, [["change"]]);
|
||||
assert.deepEqual(paths.find((op) => op.operation === "compound:batch:call")!.inputChanges, [
|
||||
["edits", null, "change"],
|
||||
]);
|
||||
assert.deepEqual(paths.find((op) => op.operation === "compound:content:edit")!.inputChanges, [[]]);
|
||||
const code = generatePortableTypeScriptBindings(plan.definition.bindingSchema, "compound:runtime@1", {
|
||||
target: "browser",
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user