diff --git a/packages/dds/tree/src/test/shared-tree/sharedTree.spec.ts b/packages/dds/tree/src/test/shared-tree/sharedTree.spec.ts index 169d28581232..ba71f02cdc84 100644 --- a/packages/dds/tree/src/test/shared-tree/sharedTree.spec.ts +++ b/packages/dds/tree/src/test/shared-tree/sharedTree.spec.ts @@ -2359,7 +2359,7 @@ describe("SharedTree", () => { }); describe("Identifiers", () => { - it("Can use identifiers and the static Tree Apis", () => { + it("can use identifiers and the static Tree Apis", () => { const sf = new SchemaFactory("com.example"); class Widget extends sf.object("Widget", { id: sf.identifier }) {} @@ -2377,6 +2377,27 @@ describe("SharedTree", () => { assert.equal(typeof Tree.shortId(widget), "number"); assert.equal(Tree.shortId(fidget), "fidget"); }); + + it.only("synchronizes correctly", async () => { + const provider = await TestTreeProvider.create(2); + + const sf = new SchemaFactory("com.example") + + class Widget extends sf.object("Widget", {id: sf.identifier}) {} + + // Apply an edit to the first tree which inserts a node with a value + const view = provider.trees[0].viewWith( + new TreeViewConfiguration({ + schema: Widget, + enableSchemaValidation, + }), + ); + view.initialize({}); + + // Ensure that the second tree receives the expected state from the first tree + await provider.ensureSynchronized(); + validateTreeConsistency(provider.trees[0], provider.trees[1]); + }); }); describe("Schema validation", () => {