@fluid-experimental/property-properties 2.100.0 → 2.101.0
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/test/properties/arrayProperty.spec.js +11 -12
- package/dist/test/properties/arrayProperty.spec.js.map +1 -1
- package/dist/test/properties/baseProperty.spec.js +4 -1
- package/dist/test/properties/baseProperty.spec.js.map +1 -1
- package/dist/test/properties/containerProperty.spec.js +1 -1
- package/dist/test/properties/containerProperty.spec.js.map +1 -1
- package/dist/test/properties/customArrayProperty.spec.js +2 -2
- package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/int64ArrayProperty.spec.js +4 -4
- package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
- package/dist/test/properties/int64Property.spec.js +2 -2
- package/dist/test/properties/int64Property.spec.js.map +1 -1
- package/dist/test/properties/isLeafNode.spec.js +1 -7
- package/dist/test/properties/isLeafNode.spec.js.map +1 -1
- package/dist/test/properties/namedNodeProperty.spec.js +1 -2
- package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
- package/dist/test/properties/nodeProperty.spec.js +1 -1
- package/dist/test/properties/nodeProperty.spec.js.map +1 -1
- package/dist/test/properties/stringProperty.spec.js +6 -5
- package/dist/test/properties/stringProperty.spec.js.map +1 -1
- package/dist/test/properties/valueMapProperty.spec.js +8 -3
- package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
- package/dist/test/properties/valueProperty.spec.js +5 -1
- package/dist/test/properties/valueProperty.spec.js.map +1 -1
- package/dist/test/propertyFactory.spec.js +15 -10
- package/dist/test/propertyFactory.spec.js.map +1 -1
- package/dist/test/tsconfig.tsbuildinfo +1 -1
- package/dist/test/utils.spec.js +13 -7
- package/dist/test/utils.spec.js.map +1 -1
- package/package.json +6 -5
|
@@ -2,20 +2,19 @@
|
|
|
2
2
|
* Copyright (c) Microsoft Corporation and contributors. All rights reserved.
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
|
-
/* globals isBrowser, assert */
|
|
5
|
+
/* globals isBrowser, assert, expect (and `chai.should()` has been called) */
|
|
6
6
|
/**
|
|
7
7
|
* @fileoverview In this file, we will test the functions of a BaseProperty object
|
|
8
8
|
* described in /src/properties/baseProperty.js
|
|
9
9
|
*/
|
|
10
10
|
const { ChangeSet } = require("@fluid-experimental/property-changeset");
|
|
11
11
|
const { MSG } = require("@fluid-experimental/property-common").constants;
|
|
12
|
-
const { DeterministicRandomGenerator
|
|
12
|
+
const { DeterministicRandomGenerator } = require("@fluid-experimental/property-common");
|
|
13
13
|
_ = require("lodash");
|
|
14
14
|
const { PropertyFactory } = require("../..");
|
|
15
15
|
const { BaseProperty } = require("../..");
|
|
16
16
|
const deepCopy = _.cloneDeep;
|
|
17
17
|
const { PATH_TOKENS } = BaseProperty;
|
|
18
|
-
var OurArrayTestTemplate;
|
|
19
18
|
var arrayProp;
|
|
20
19
|
var testFailed = false;
|
|
21
20
|
var changeSet2;
|
|
@@ -569,7 +568,7 @@ describe("ArrayProperty", function () {
|
|
|
569
568
|
});
|
|
570
569
|
it(".setValues and .getValues should work for primitive arrays", function () {
|
|
571
570
|
// tests for getValues on typed arrays fail but only on PhantomJS.
|
|
572
|
-
if (isBrowser && window.top.callPhantom) {
|
|
571
|
+
if (isBrowser && /** @type {any} */ (window.top).callPhantom) {
|
|
573
572
|
this.skip();
|
|
574
573
|
}
|
|
575
574
|
var MyArrayProp = PropertyFactory.create("autodesk.test:test.dynamicArray-1.0.0")
|
|
@@ -1039,18 +1038,18 @@ describe("ArrayProperty", function () {
|
|
|
1039
1038
|
var values = ["test1", "test2"];
|
|
1040
1039
|
testArrayOperation(values, { insert: [[0, values]] });
|
|
1041
1040
|
// Overwriting with a different array
|
|
1042
|
-
|
|
1041
|
+
values = ["test3"];
|
|
1043
1042
|
testArrayOperation(values, { insert: [[0, values]] });
|
|
1044
1043
|
// A second deserialization to the same array should preserve the changeset
|
|
1045
|
-
|
|
1044
|
+
values = ["test3"];
|
|
1046
1045
|
testArrayOperation(values, { insert: [[0, values]] });
|
|
1047
1046
|
// Now we clean the array and overwrite
|
|
1048
1047
|
testArray.cleanDirty();
|
|
1049
|
-
|
|
1048
|
+
values = ["test1", "test2"];
|
|
1050
1049
|
testArrayOperation(values, { insert: [[0, values]], remove: [[0, 1]] });
|
|
1051
1050
|
// A second deserialization to the same array
|
|
1052
1051
|
testArray.cleanDirty();
|
|
1053
|
-
|
|
1052
|
+
values = ["test1", "test2"];
|
|
1054
1053
|
if (primitiveProperty) {
|
|
1055
1054
|
// should report no change for primitive properties
|
|
1056
1055
|
testArrayOperation(values, {});
|
|
@@ -1061,11 +1060,11 @@ describe("ArrayProperty", function () {
|
|
|
1061
1060
|
}
|
|
1062
1061
|
// Creating an empty array
|
|
1063
1062
|
testArray.cleanDirty();
|
|
1064
|
-
|
|
1063
|
+
values = [];
|
|
1065
1064
|
testArrayOperation(values, { remove: [[0, 2]] });
|
|
1066
1065
|
// A second serialization to an empty array should report no change
|
|
1067
1066
|
testArray.cleanDirty();
|
|
1068
|
-
|
|
1067
|
+
values = [];
|
|
1069
1068
|
testArrayOperation(values, {});
|
|
1070
1069
|
};
|
|
1071
1070
|
it("of a primitive array property", function () {
|
|
@@ -1079,7 +1078,7 @@ describe("ArrayProperty", function () {
|
|
|
1079
1078
|
})).to.deep.equal(expectedChangeSet);
|
|
1080
1079
|
expect(stringArray.serialize({
|
|
1081
1080
|
dirtyOnly: true,
|
|
1082
|
-
dirtinessType: BaseProperty.MODIFIED_STATE_FLAGS.
|
|
1081
|
+
dirtinessType: BaseProperty.MODIFIED_STATE_FLAGS.DIRTY,
|
|
1083
1082
|
})).to.deep.equal(expectedChangeSet);
|
|
1084
1083
|
};
|
|
1085
1084
|
runDeserializationTests(testArrayOperation, stringArray, true);
|
|
@@ -1114,7 +1113,7 @@ describe("ArrayProperty", function () {
|
|
|
1114
1113
|
})).to.deep.equal(expectedChangeSet);
|
|
1115
1114
|
expect(testArray.serialize({
|
|
1116
1115
|
dirtyOnly: true,
|
|
1117
|
-
dirtinessType: BaseProperty.MODIFIED_STATE_FLAGS.
|
|
1116
|
+
dirtinessType: BaseProperty.MODIFIED_STATE_FLAGS.DIRTY,
|
|
1118
1117
|
})).to.deep.equal(expectedChangeSet);
|
|
1119
1118
|
};
|
|
1120
1119
|
runDeserializationTests(testArrayOperation, testArray, false);
|