mirror of
https://github.com/yjs/yjs.git
synced 2026-01-07 12:56:39 +01:00
added test case
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user