@fluid-experimental/property-properties 0.58.1001 → 0.58.2000-58133
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/containerSerializer.d.ts.map +1 -1
- package/dist/containerSerializer.js +4 -10
- package/dist/containerSerializer.js.map +1 -1
- package/dist/enableValidations.d.ts.map +1 -1
- package/dist/enableValidations.js +1 -1
- package/dist/enableValidations.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
- package/dist/properties/abstractStaticCollectionProperty.js +1 -28
- package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/dist/properties/arrayProperty.d.ts.map +1 -1
- package/dist/properties/arrayProperty.js +26 -85
- package/dist/properties/arrayProperty.js.map +1 -1
- package/dist/properties/baseProperty.d.ts.map +1 -1
- package/dist/properties/baseProperty.js +9 -71
- package/dist/properties/baseProperty.js.map +1 -1
- package/dist/properties/boolProperty.d.ts.map +1 -1
- package/dist/properties/boolProperty.js +0 -1
- package/dist/properties/boolProperty.js.map +1 -1
- package/dist/properties/containerProperty.d.ts.map +1 -1
- package/dist/properties/containerProperty.js +4 -22
- package/dist/properties/containerProperty.js.map +1 -1
- package/dist/properties/enumArrayProperty.d.ts.map +1 -1
- package/dist/properties/enumArrayProperty.js +2 -14
- package/dist/properties/enumArrayProperty.js.map +1 -1
- package/dist/properties/enumProperty.d.ts.map +1 -1
- package/dist/properties/enumProperty.js +3 -10
- package/dist/properties/enumProperty.js.map +1 -1
- package/dist/properties/floatProperties.js +0 -2
- package/dist/properties/floatProperties.js.map +1 -1
- package/dist/properties/index.d.ts +7 -38
- package/dist/properties/index.d.ts.map +1 -1
- package/dist/properties/index.js +37 -68
- package/dist/properties/index.js.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
- package/dist/properties/indexedCollectionBaseProperty.js +6 -18
- package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/dist/properties/intProperties.d.ts.map +1 -1
- package/dist/properties/intProperties.js +3 -20
- package/dist/properties/intProperties.js.map +1 -1
- package/dist/properties/lazyLoadedProperties.js.map +1 -1
- package/dist/properties/mapProperty.d.ts.map +1 -1
- package/dist/properties/mapProperty.js +4 -23
- package/dist/properties/mapProperty.js.map +1 -1
- package/dist/properties/namedNodeProperty.d.ts.map +1 -1
- package/dist/properties/namedNodeProperty.js.map +1 -1
- package/dist/properties/namedProperty.d.ts.map +1 -1
- package/dist/properties/namedProperty.js +0 -3
- package/dist/properties/namedProperty.js.map +1 -1
- package/dist/properties/nodeProperty.d.ts.map +1 -1
- package/dist/properties/nodeProperty.js +0 -3
- package/dist/properties/nodeProperty.js.map +1 -1
- package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
- package/dist/properties/primitiveTypeCasts.js +2 -2
- package/dist/properties/primitiveTypeCasts.js.map +1 -1
- package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
- package/dist/properties/referenceArrayProperty.js +3 -16
- package/dist/properties/referenceArrayProperty.js.map +1 -1
- package/dist/properties/referenceMapProperty.d.ts.map +1 -1
- package/dist/properties/referenceMapProperty.js +3 -13
- package/dist/properties/referenceMapProperty.js.map +1 -1
- package/dist/properties/referenceProperty.d.ts.map +1 -1
- package/dist/properties/referenceProperty.js +4 -12
- package/dist/properties/referenceProperty.js.map +1 -1
- package/dist/properties/setProperty.d.ts.map +1 -1
- package/dist/properties/setProperty.js +3 -22
- package/dist/properties/setProperty.js.map +1 -1
- package/dist/properties/stringProperty.d.ts.map +1 -1
- package/dist/properties/stringProperty.js +12 -48
- package/dist/properties/stringProperty.js.map +1 -1
- package/dist/properties/uintProperties.js +0 -3
- package/dist/properties/uintProperties.js.map +1 -1
- package/dist/properties/valueArrayProperty.d.ts.map +1 -1
- package/dist/properties/valueArrayProperty.js +3 -45
- package/dist/properties/valueArrayProperty.js.map +1 -1
- package/dist/properties/valueMapProperty.d.ts.map +1 -1
- package/dist/properties/valueMapProperty.js +4 -29
- package/dist/properties/valueMapProperty.js.map +1 -1
- package/dist/properties/valueProperty.d.ts.map +1 -1
- package/dist/properties/valueProperty.js +2 -14
- package/dist/properties/valueProperty.js.map +1 -1
- package/dist/propertyFactory.d.ts.map +1 -1
- package/dist/propertyFactory.js +35 -72
- package/dist/propertyFactory.js.map +1 -1
- package/dist/propertyTemplate.d.ts.map +1 -1
- package/dist/propertyTemplate.js +0 -14
- package/dist/propertyTemplate.js.map +1 -1
- package/dist/propertyTemplateWrapper.d.ts.map +1 -1
- package/dist/propertyTemplateWrapper.js +4 -12
- package/dist/propertyTemplateWrapper.js.map +1 -1
- package/dist/propertyUtils.d.ts.map +1 -1
- package/dist/propertyUtils.js.map +1 -1
- package/dist/test/properties/arrayProperty.spec.js +82 -82
- package/dist/test/properties/arrayProperty.spec.js.map +1 -1
- package/dist/test/properties/baseProperty.spec.js +53 -53
- package/dist/test/properties/baseProperty.spec.js.map +1 -1
- package/dist/test/properties/containerProperty.spec.js +25 -25
- package/dist/test/properties/containerProperty.spec.js.map +1 -1
- package/dist/test/properties/customArrayProperty.spec.js +35 -35
- package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumArrayProperty.spec.js +6 -6
- package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/enumProperty.spec.js +26 -26
- package/dist/test/properties/enumProperty.spec.js.map +1 -1
- package/dist/test/properties/float32.spec.js.map +1 -1
- package/dist/test/properties/int64ArrayProperty.spec.js +22 -22
- package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/int64MapProperty.spec.js +28 -28
- package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
- package/dist/test/properties/int64Property.spec.js +11 -11
- package/dist/test/properties/int64Property.spec.js.map +1 -1
- package/dist/test/properties/isLeafNode.spec.js +25 -25
- package/dist/test/properties/isLeafNode.spec.js.map +1 -1
- package/dist/test/properties/mapProperty.spec.js +110 -110
- package/dist/test/properties/mapProperty.spec.js.map +1 -1
- package/dist/test/properties/namedNodeProperty.spec.js +5 -5
- package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
- package/dist/test/properties/nodeProperty.spec.js +160 -160
- package/dist/test/properties/nodeProperty.spec.js.map +1 -1
- package/dist/test/properties/referenceProperty.spec.js +21 -21
- package/dist/test/properties/referenceProperty.spec.js.map +1 -1
- package/dist/test/properties/relationshipProperty.spec.js +4 -4
- package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
- package/dist/test/properties/setProperty.spec.js +32 -32
- package/dist/test/properties/setProperty.spec.js.map +1 -1
- package/dist/test/properties/stringProperty.spec.js +38 -38
- package/dist/test/properties/stringProperty.spec.js.map +1 -1
- package/dist/test/properties/uint64Property.spec.js +3 -3
- package/dist/test/properties/uint64Property.spec.js.map +1 -1
- package/dist/test/properties/valueMapProperty.spec.js +28 -28
- package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
- package/dist/test/properties/valueProperty.spec.js +7 -7
- package/dist/test/properties/valueProperty.spec.js.map +1 -1
- package/dist/test/propertyFactory.spec.js +559 -560
- package/dist/test/propertyFactory.spec.js.map +1 -1
- package/dist/test/propertyTemplateWrapper.spec.js +38 -38
- package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
- package/dist/test/propertyUtils.spec.js +5 -5
- package/dist/test/propertyUtils.spec.js.map +1 -1
- package/dist/test/reversibleChangeset.spec.js +266 -266
- package/dist/test/reversibleChangeset.spec.js.map +1 -1
- package/dist/test/setup.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +145 -145
- package/dist/test/utils.spec.js +508 -517
- package/dist/test/utils.spec.js.map +1 -1
- package/dist/test/validation/badMissingSemverInTypeid.js +9 -9
- package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
- package/dist/test/validation/badPrimitiveTypeid.js +5 -5
- package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
- package/dist/test/validation/goodColorId.js +42 -42
- package/dist/test/validation/goodColorId.js.map +1 -1
- package/dist/test/validation/goodColorPalette.js +2 -2
- package/dist/test/validation/goodColorPalette.js.map +1 -1
- package/dist/test/validation/goodPointId.js +9 -9
- package/dist/test/validation/goodPointId.js.map +1 -1
- package/dist/test/validation/reversibleChangeSetTestData.js +1 -1
- package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
- package/lib/containerSerializer.js +4 -10
- package/lib/containerSerializer.js.map +1 -1
- package/lib/enableValidations.js +1 -1
- package/lib/enableValidations.js.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/properties/abstractStaticCollectionProperty.js +1 -28
- package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
- package/lib/properties/arrayProperty.js +26 -85
- package/lib/properties/arrayProperty.js.map +1 -1
- package/lib/properties/baseProperty.js +7 -69
- package/lib/properties/baseProperty.js.map +1 -1
- package/lib/properties/boolProperty.js +0 -1
- package/lib/properties/boolProperty.js.map +1 -1
- package/lib/properties/containerProperty.js +4 -22
- package/lib/properties/containerProperty.js.map +1 -1
- package/lib/properties/enumArrayProperty.js +2 -14
- package/lib/properties/enumArrayProperty.js.map +1 -1
- package/lib/properties/enumProperty.js +3 -10
- package/lib/properties/enumProperty.js.map +1 -1
- package/lib/properties/floatProperties.js +0 -2
- package/lib/properties/floatProperties.js.map +1 -1
- package/lib/properties/index.js +7 -38
- package/lib/properties/index.js.map +1 -1
- package/lib/properties/indexedCollectionBaseProperty.js +6 -18
- package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
- package/lib/properties/intProperties.js +3 -20
- package/lib/properties/intProperties.js.map +1 -1
- package/lib/properties/lazyLoadedProperties.js.map +1 -1
- package/lib/properties/mapProperty.js +4 -23
- package/lib/properties/mapProperty.js.map +1 -1
- package/lib/properties/namedNodeProperty.js.map +1 -1
- package/lib/properties/namedProperty.js +0 -3
- package/lib/properties/namedProperty.js.map +1 -1
- package/lib/properties/nodeProperty.js +0 -3
- package/lib/properties/nodeProperty.js.map +1 -1
- package/lib/properties/primitiveTypeCasts.js +2 -2
- package/lib/properties/primitiveTypeCasts.js.map +1 -1
- package/lib/properties/referenceArrayProperty.js +3 -16
- package/lib/properties/referenceArrayProperty.js.map +1 -1
- package/lib/properties/referenceMapProperty.js +3 -13
- package/lib/properties/referenceMapProperty.js.map +1 -1
- package/lib/properties/referenceProperty.js +4 -12
- package/lib/properties/referenceProperty.js.map +1 -1
- package/lib/properties/setProperty.js +3 -22
- package/lib/properties/setProperty.js.map +1 -1
- package/lib/properties/stringProperty.js +12 -48
- package/lib/properties/stringProperty.js.map +1 -1
- package/lib/properties/uintProperties.js +0 -3
- package/lib/properties/uintProperties.js.map +1 -1
- package/lib/properties/valueArrayProperty.js +3 -45
- package/lib/properties/valueArrayProperty.js.map +1 -1
- package/lib/properties/valueMapProperty.js +4 -29
- package/lib/properties/valueMapProperty.js.map +1 -1
- package/lib/properties/valueProperty.js +2 -14
- package/lib/properties/valueProperty.js.map +1 -1
- package/lib/propertyFactory.js +35 -72
- package/lib/propertyFactory.js.map +1 -1
- package/lib/propertyTemplate.js +0 -14
- package/lib/propertyTemplate.js.map +1 -1
- package/lib/propertyTemplateWrapper.js +4 -12
- package/lib/propertyTemplateWrapper.js.map +1 -1
- package/lib/propertyUtils.js.map +1 -1
- package/package.json +13 -6
|
@@ -2,16 +2,16 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
/* eslint-disable no-unused-expressions*/
|
|
5
|
+
/* eslint-disable no-unused-expressions */
|
|
6
6
|
/**
|
|
7
7
|
* @fileoverview In this file, we will test the string property
|
|
8
8
|
* object described in /src/properties/stringProperty.js
|
|
9
9
|
*/
|
|
10
|
+
const { ChangeSet } = require('@fluid-experimental/property-changeset');
|
|
11
|
+
const { MSG } = require('@fluid-experimental/property-common').constants;
|
|
10
12
|
const _ = require('lodash');
|
|
11
13
|
const { PropertyFactory } = require('../..');
|
|
12
14
|
const { BaseProperty } = require('../..');
|
|
13
|
-
const { ChangeSet } = require('@fluid-experimental/property-changeset');
|
|
14
|
-
const { MSG } = require('@fluid-experimental/property-common').constants;
|
|
15
15
|
const deepCopy = _.cloneDeep;
|
|
16
16
|
describe('StringProperty', function () {
|
|
17
17
|
var changeSetWithEntries, removalChangeSet;
|
|
@@ -21,8 +21,8 @@ describe('StringProperty', function () {
|
|
|
21
21
|
var SimpleStringTestPropertyTemplate = {
|
|
22
22
|
typeid: 'autodesk.tests:SimpleStringTestProperty-1.0.0',
|
|
23
23
|
properties: [
|
|
24
|
-
{ id: 'stringProperty', typeid: 'String' }
|
|
25
|
-
]
|
|
24
|
+
{ id: 'stringProperty', typeid: 'String' },
|
|
25
|
+
],
|
|
26
26
|
};
|
|
27
27
|
PropertyFactory._reregister(SimpleStringTestPropertyTemplate);
|
|
28
28
|
myStringProp = PropertyFactory.create('String');
|
|
@@ -293,7 +293,7 @@ describe('StringProperty', function () {
|
|
|
293
293
|
t.cleanDirty();
|
|
294
294
|
t.insert(2, '_test_');
|
|
295
295
|
expect(t.serialize({ 'dirtyOnly': true })).to.deep.equal({
|
|
296
|
-
'insert': [[2, '_test_']]
|
|
296
|
+
'insert': [[2, '_test_']],
|
|
297
297
|
});
|
|
298
298
|
});
|
|
299
299
|
it('Should handle push correctly', function () {
|
|
@@ -302,7 +302,7 @@ describe('StringProperty', function () {
|
|
|
302
302
|
t.cleanDirty();
|
|
303
303
|
t.push('_test_');
|
|
304
304
|
expect(t.serialize({ 'dirtyOnly': true })).to.deep.equal({
|
|
305
|
-
'insert': [[4, '_test_']]
|
|
305
|
+
'insert': [[4, '_test_']],
|
|
306
306
|
});
|
|
307
307
|
});
|
|
308
308
|
it('Should handle modifies correctly', function () {
|
|
@@ -311,7 +311,7 @@ describe('StringProperty', function () {
|
|
|
311
311
|
t.cleanDirty();
|
|
312
312
|
t.setRange(1, '_x_');
|
|
313
313
|
expect(t.serialize({ 'dirtyOnly': true })).to.deep.equal({
|
|
314
|
-
'modify': [[1, '_x_']]
|
|
314
|
+
'modify': [[1, '_x_']],
|
|
315
315
|
});
|
|
316
316
|
});
|
|
317
317
|
});
|
|
@@ -416,12 +416,12 @@ describe('StringProperty', function () {
|
|
|
416
416
|
callbacks: [insertText, insertText, removeText, removeText],
|
|
417
417
|
post: function (changeset) {
|
|
418
418
|
expect(changeset).to.be.empty;
|
|
419
|
-
}
|
|
419
|
+
},
|
|
420
420
|
});
|
|
421
421
|
});
|
|
422
422
|
it('should work for mixed modifies and inserts', function () {
|
|
423
423
|
testChangeSetSquashing({
|
|
424
|
-
callbacks: [insertText, modifyText, insertText, modifyText]
|
|
424
|
+
callbacks: [insertText, modifyText, insertText, modifyText],
|
|
425
425
|
});
|
|
426
426
|
});
|
|
427
427
|
it('an insert, modify and a remove should give an empty changeset', function () {
|
|
@@ -429,13 +429,13 @@ describe('StringProperty', function () {
|
|
|
429
429
|
callbacks: [insertText, modifyText, removeText],
|
|
430
430
|
post: function (changeset) {
|
|
431
431
|
expect(changeset).to.be.empty;
|
|
432
|
-
}
|
|
432
|
+
},
|
|
433
433
|
});
|
|
434
434
|
});
|
|
435
435
|
it('work for modifies after an already existing insert', function () {
|
|
436
436
|
testChangeSetSquashing({
|
|
437
437
|
pre: insertText,
|
|
438
|
-
callbacks: [modifyText, modifyText]
|
|
438
|
+
callbacks: [modifyText, modifyText],
|
|
439
439
|
});
|
|
440
440
|
});
|
|
441
441
|
it('of modify and remove after an already existing insert should work', function () {
|
|
@@ -444,7 +444,7 @@ describe('StringProperty', function () {
|
|
|
444
444
|
callbacks: [modifyText, removeText],
|
|
445
445
|
post: function (changeset) {
|
|
446
446
|
expect(changeset.String.stringProperty).to.have.all.keys('remove');
|
|
447
|
-
}
|
|
447
|
+
},
|
|
448
448
|
});
|
|
449
449
|
});
|
|
450
450
|
it('modify after set should work', function () {
|
|
@@ -452,7 +452,7 @@ describe('StringProperty', function () {
|
|
|
452
452
|
callbacks: [setText, modifyText],
|
|
453
453
|
post: function (changeset) {
|
|
454
454
|
expect(changeset.String.stringProperty).to.equal('y');
|
|
455
|
-
}
|
|
455
|
+
},
|
|
456
456
|
});
|
|
457
457
|
});
|
|
458
458
|
it('set after pre-insert and insert should work', function () {
|
|
@@ -461,7 +461,7 @@ describe('StringProperty', function () {
|
|
|
461
461
|
callbacks: [insertText, modifyText, setText],
|
|
462
462
|
post: function (changeset) {
|
|
463
463
|
expect(changeset.String.stringProperty).to.equal('s');
|
|
464
|
-
}
|
|
464
|
+
},
|
|
465
465
|
});
|
|
466
466
|
});
|
|
467
467
|
it('insert after set should work', function () {
|
|
@@ -469,7 +469,7 @@ describe('StringProperty', function () {
|
|
|
469
469
|
callbacks: [setText, insertText],
|
|
470
470
|
post: function (changeset) {
|
|
471
471
|
expect(changeset.String.stringProperty).to.equal('xs');
|
|
472
|
-
}
|
|
472
|
+
},
|
|
473
473
|
});
|
|
474
474
|
});
|
|
475
475
|
it('insert, set, insert/modify should work', function () {
|
|
@@ -477,7 +477,7 @@ describe('StringProperty', function () {
|
|
|
477
477
|
callbacks: [insertText, setText, insertText, modifyText],
|
|
478
478
|
post: function (changeset) {
|
|
479
479
|
expect(changeset.String.stringProperty).to.equal('ys');
|
|
480
|
-
}
|
|
480
|
+
},
|
|
481
481
|
});
|
|
482
482
|
});
|
|
483
483
|
it('insert, set, insert/modify, set should work', function () {
|
|
@@ -485,7 +485,7 @@ describe('StringProperty', function () {
|
|
|
485
485
|
callbacks: [insertText, setText, insertText, modifyText, setText],
|
|
486
486
|
post: function (changeset) {
|
|
487
487
|
expect(changeset.String.stringProperty).to.equal('s');
|
|
488
|
-
}
|
|
488
|
+
},
|
|
489
489
|
});
|
|
490
490
|
});
|
|
491
491
|
});
|
|
@@ -594,14 +594,14 @@ describe('StringProperty', function () {
|
|
|
594
594
|
it('with a NOP should be possible', function () {
|
|
595
595
|
testRebasing({
|
|
596
596
|
op2: insertText,
|
|
597
|
-
compareToSequential: true
|
|
597
|
+
compareToSequential: true,
|
|
598
598
|
});
|
|
599
599
|
});
|
|
600
600
|
it('with independent inserts should be possible', function () {
|
|
601
601
|
testRebasing({
|
|
602
602
|
op1: insertText,
|
|
603
603
|
op2: insertText,
|
|
604
|
-
compareToSequential: true
|
|
604
|
+
compareToSequential: true,
|
|
605
605
|
});
|
|
606
606
|
});
|
|
607
607
|
it('with independent removes should be possible', function () {
|
|
@@ -616,7 +616,7 @@ describe('StringProperty', function () {
|
|
|
616
616
|
op2: function (root) {
|
|
617
617
|
root.removeRange(0, 1);
|
|
618
618
|
},
|
|
619
|
-
compareToSequential: true
|
|
619
|
+
compareToSequential: true,
|
|
620
620
|
});
|
|
621
621
|
});
|
|
622
622
|
it('with a modify and a remove should possible', function () {
|
|
@@ -624,7 +624,7 @@ describe('StringProperty', function () {
|
|
|
624
624
|
prepare: insertText,
|
|
625
625
|
op1: modifyText,
|
|
626
626
|
op2: removeText,
|
|
627
|
-
compareToSequential: true
|
|
627
|
+
compareToSequential: true,
|
|
628
628
|
});
|
|
629
629
|
});
|
|
630
630
|
it('with a remove and a modify should possible', function () {
|
|
@@ -637,7 +637,7 @@ describe('StringProperty', function () {
|
|
|
637
637
|
expect(conflicts).to.have.length(1);
|
|
638
638
|
expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.ENTRY_MODIFIED_AFTER_REMOVE);
|
|
639
639
|
expect(conflicts[0].path).to.be.equal('stringProperty');
|
|
640
|
-
}
|
|
640
|
+
},
|
|
641
641
|
});
|
|
642
642
|
});
|
|
643
643
|
it('with two compatible removes should be possible', function () {
|
|
@@ -648,7 +648,7 @@ describe('StringProperty', function () {
|
|
|
648
648
|
compareToSequential: false,
|
|
649
649
|
checkResult: function (conflicts, changeSet) {
|
|
650
650
|
expect(ChangeSet.isEmptyChangeSet(changeSet)).to.be.ok;
|
|
651
|
-
}
|
|
651
|
+
},
|
|
652
652
|
});
|
|
653
653
|
});
|
|
654
654
|
it('with two independent modifies should be possible', function () {
|
|
@@ -663,7 +663,7 @@ describe('StringProperty', function () {
|
|
|
663
663
|
compareToSequential: true,
|
|
664
664
|
checkResult: function (conflicts, changeSet) {
|
|
665
665
|
expect(conflicts).to.be.empty;
|
|
666
|
-
}
|
|
666
|
+
},
|
|
667
667
|
});
|
|
668
668
|
});
|
|
669
669
|
// TODO: test with the same value
|
|
@@ -680,7 +680,7 @@ describe('StringProperty', function () {
|
|
|
680
680
|
expect(changeSet.String.stringProperty.modify[0][1]).to.equal('y');
|
|
681
681
|
expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);
|
|
682
682
|
expect(conflicts[0].path).to.be.equal('stringProperty');
|
|
683
|
-
}
|
|
683
|
+
},
|
|
684
684
|
});
|
|
685
685
|
});
|
|
686
686
|
it('with modify followed by remove+insert should work', function () {
|
|
@@ -697,7 +697,7 @@ describe('StringProperty', function () {
|
|
|
697
697
|
expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.REMOVE_AFTER_MODIFY);
|
|
698
698
|
expect(conflicts[0].path).to.be.equal('stringProperty');
|
|
699
699
|
expect(changeSet.String.stringProperty).to.have.all.keys('remove', 'insert');
|
|
700
|
-
}
|
|
700
|
+
},
|
|
701
701
|
});
|
|
702
702
|
});
|
|
703
703
|
it('with remove + insert followed by modify should report conflict', function () {
|
|
@@ -713,7 +713,7 @@ describe('StringProperty', function () {
|
|
|
713
713
|
expect(conflicts).to.have.length(1);
|
|
714
714
|
expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.ENTRY_MODIFIED_AFTER_REMOVE);
|
|
715
715
|
expect(conflicts[0].path).to.be.equal('stringProperty');
|
|
716
|
-
}
|
|
716
|
+
},
|
|
717
717
|
});
|
|
718
718
|
});
|
|
719
719
|
it('with conflicting inserts should report conflict', function () {
|
|
@@ -726,7 +726,7 @@ describe('StringProperty', function () {
|
|
|
726
726
|
expect(conflicts).to.have.length(1);
|
|
727
727
|
expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.INSERTED_ENTRY_WITH_SAME_KEY);
|
|
728
728
|
expect(conflicts[0].path).to.be.equal('stringProperty');
|
|
729
|
-
}
|
|
729
|
+
},
|
|
730
730
|
});
|
|
731
731
|
});
|
|
732
732
|
it('with conflicting remove and insert should keep the insert and move it to the correct position', function () {
|
|
@@ -744,9 +744,9 @@ describe('StringProperty', function () {
|
|
|
744
744
|
checkResult: function (conflicts, changeSet) {
|
|
745
745
|
expect(conflicts).to.have.length(0);
|
|
746
746
|
expect(changeSet).to.deep.equal({
|
|
747
|
-
'String': { stringProperty: { insert: [[2, 't']] } }
|
|
747
|
+
'String': { stringProperty: { insert: [[2, 't']] } },
|
|
748
748
|
});
|
|
749
|
-
}
|
|
749
|
+
},
|
|
750
750
|
});
|
|
751
751
|
});
|
|
752
752
|
it('with touching remove and insert should not report conflict and keep them', function () {
|
|
@@ -766,7 +766,7 @@ describe('StringProperty', function () {
|
|
|
766
766
|
expect(conflicts).to.have.length(0);
|
|
767
767
|
expect(rebasedCS2).to.deep.equal({ 'String': { stringProperty: { insert: [[2, 'ab']] } } });
|
|
768
768
|
expect(combinedChangeSet).to.deep.equal({ 'String': { 'stringProperty': '01ab56' } });
|
|
769
|
-
}
|
|
769
|
+
},
|
|
770
770
|
});
|
|
771
771
|
});
|
|
772
772
|
it('with conflicting set and insert should report a conflict', function () {
|
|
@@ -780,7 +780,7 @@ describe('StringProperty', function () {
|
|
|
780
780
|
expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);
|
|
781
781
|
expect(conflicts[0].path).to.be.equal('stringProperty');
|
|
782
782
|
expect(changeSet.String.stringProperty).to.be.equal('s');
|
|
783
|
-
}
|
|
783
|
+
},
|
|
784
784
|
});
|
|
785
785
|
});
|
|
786
786
|
it('with conflicting insert and set should report a conflict', function () {
|
|
@@ -794,7 +794,7 @@ describe('StringProperty', function () {
|
|
|
794
794
|
expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);
|
|
795
795
|
expect(conflicts[0].path).to.be.equal('stringProperty');
|
|
796
796
|
expect(changeSet.String.stringProperty).to.be.equal('s');
|
|
797
|
-
}
|
|
797
|
+
},
|
|
798
798
|
});
|
|
799
799
|
});
|
|
800
800
|
it('should correctly handle boundary cases', function () {
|
|
@@ -825,8 +825,8 @@ describe('StringProperty', function () {
|
|
|
825
825
|
var SchemaStringWithLength = {
|
|
826
826
|
typeid: 'autodesk.tests:SchemaStringWithLength-1.0.0',
|
|
827
827
|
properties: [
|
|
828
|
-
{ id: 'stringProperty', typeid: 'String', length: 4 }
|
|
829
|
-
]
|
|
828
|
+
{ id: 'stringProperty', typeid: 'String', length: 4 },
|
|
829
|
+
],
|
|
830
830
|
};
|
|
831
831
|
PropertyFactory.register(SchemaStringWithLength);
|
|
832
832
|
var prop = PropertyFactory.create(SchemaStringWithLength.typeid);
|
|
@@ -836,8 +836,8 @@ describe('StringProperty', function () {
|
|
|
836
836
|
var SchemaStringWithStringLength = {
|
|
837
837
|
typeid: 'autodesk.tests:SchemaStringWithStringLength-1.0.0',
|
|
838
838
|
properties: [
|
|
839
|
-
{ id: 'stringProperty', typeid: 'String', length: '4' }
|
|
840
|
-
]
|
|
839
|
+
{ id: 'stringProperty', typeid: 'String', length: '4' },
|
|
840
|
+
],
|
|
841
841
|
};
|
|
842
842
|
PropertyFactory.register(SchemaStringWithStringLength);
|
|
843
843
|
var prop = PropertyFactory.create(SchemaStringWithStringLength.typeid);
|