added not working tests
This commit is contained in:
parent
f8ad9abcc0
commit
9d0373b85b
@ -176,17 +176,17 @@ var Struct = {
|
||||
}
|
||||
}
|
||||
while (true) {
|
||||
if (o.id !== op.right){
|
||||
if (o != null && o.id !== op.right){
|
||||
if (Struct.Insert.getDistanceToOrigin(o) === i) {
|
||||
// case 1
|
||||
if (o.id[0] < op.id[0]) {
|
||||
op.left = o;
|
||||
op.left = o.id;
|
||||
distanceToOrigin = i + 1;
|
||||
}
|
||||
} else if ((tmp = Struct.Insert.getDistanceToOrigin(o)) < i) {
|
||||
// case 2
|
||||
if (i - distanceToOrigin <= tmp) {
|
||||
op.left = o;
|
||||
op.left = o.id;
|
||||
distanceToOrigin = i + 1;
|
||||
}
|
||||
} else {
|
||||
|
@ -64,4 +64,26 @@ describe("Yjs (basic)", function(){
|
||||
u.transact(transaction);
|
||||
}
|
||||
});
|
||||
it("Basic get&set of Map property (handle conflict)", 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");
|
||||
});
|
||||
|
||||
var transaction = function*(root){
|
||||
expect(yield* root.val("stuff")).toEqual("c1");
|
||||
};
|
||||
y.connector.flushAll();
|
||||
|
||||
for (var key in this.users) {
|
||||
var u = this.users[key];
|
||||
u.transact(transaction);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user