diff --git a/src/y.spec.js b/src/y.spec.js index 3a96b191..7d88985c 100644 --- a/src/y.spec.js +++ b/src/y.spec.js @@ -84,6 +84,30 @@ describe("Yjs (basic)", function(){ u.transact(transaction); } }); + it("Basic get&set of Map property (handle three conflicts)", function(){ + var y = this.users[0]; + y.connector.flushAll(); + this.users[0].transact(function*(root){ + yield* root.val("stuff", "c0"); + }); + this.users[1].transact(function*(root){ + yield* root.val("stuff", "c1"); + }); + this.users[2].transact(function*(root){ + yield* root.val("stuff", "c2"); + }); + this.users[3].transact(function*(root){ + yield* root.val("stuff", "c3"); + }); + y.connector.flushAll(); + var transaction = function*(root){ + expect(yield* root.val("stuff")).toEqual("c0"); + }; + for (var key in this.users) { + var u = this.users[key]; + u.transact(transaction); + } + }); });