@fluid-experimental/property-properties 2.0.0-internal.3.0.2 → 2.0.0-internal.3.2.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.
Files changed (266) hide show
  1. package/README.md +1 -0
  2. package/dist/containerSerializer.d.ts.map +1 -1
  3. package/dist/containerSerializer.js +5 -5
  4. package/dist/containerSerializer.js.map +1 -1
  5. package/dist/enableValidations.js.map +1 -1
  6. package/dist/index.d.ts +19 -19
  7. package/dist/index.d.ts.map +1 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/properties/abstractStaticCollectionProperty.d.ts +10 -10
  10. package/dist/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
  11. package/dist/properties/abstractStaticCollectionProperty.js +70 -53
  12. package/dist/properties/abstractStaticCollectionProperty.js.map +1 -1
  13. package/dist/properties/arrayProperty.d.ts.map +1 -1
  14. package/dist/properties/arrayProperty.js +152 -103
  15. package/dist/properties/arrayProperty.js.map +1 -1
  16. package/dist/properties/baseProperty.d.ts +4 -4
  17. package/dist/properties/baseProperty.d.ts.map +1 -1
  18. package/dist/properties/baseProperty.js +69 -47
  19. package/dist/properties/baseProperty.js.map +1 -1
  20. package/dist/properties/boolProperty.d.ts.map +1 -1
  21. package/dist/properties/boolProperty.js +3 -3
  22. package/dist/properties/boolProperty.js.map +1 -1
  23. package/dist/properties/containerProperty.d.ts +8 -8
  24. package/dist/properties/containerProperty.d.ts.map +1 -1
  25. package/dist/properties/containerProperty.js +33 -26
  26. package/dist/properties/containerProperty.js.map +1 -1
  27. package/dist/properties/enumArrayProperty.d.ts.map +1 -1
  28. package/dist/properties/enumArrayProperty.js +14 -14
  29. package/dist/properties/enumArrayProperty.js.map +1 -1
  30. package/dist/properties/enumProperty.d.ts.map +1 -1
  31. package/dist/properties/enumProperty.js +17 -17
  32. package/dist/properties/enumProperty.js.map +1 -1
  33. package/dist/properties/floatProperties.js +4 -4
  34. package/dist/properties/floatProperties.js.map +1 -1
  35. package/dist/properties/index.d.ts +23 -23
  36. package/dist/properties/index.d.ts.map +1 -1
  37. package/dist/properties/index.js.map +1 -1
  38. package/dist/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
  39. package/dist/properties/indexedCollectionBaseProperty.js +47 -37
  40. package/dist/properties/indexedCollectionBaseProperty.js.map +1 -1
  41. package/dist/properties/intProperties.d.ts.map +1 -1
  42. package/dist/properties/intProperties.js +10 -10
  43. package/dist/properties/intProperties.js.map +1 -1
  44. package/dist/properties/lazyLoadedProperties.js.map +1 -1
  45. package/dist/properties/mapProperty.d.ts.map +1 -1
  46. package/dist/properties/mapProperty.js +21 -17
  47. package/dist/properties/mapProperty.js.map +1 -1
  48. package/dist/properties/namedNodeProperty.d.ts.map +1 -1
  49. package/dist/properties/namedNodeProperty.js +3 -3
  50. package/dist/properties/namedNodeProperty.js.map +1 -1
  51. package/dist/properties/namedProperty.d.ts.map +1 -1
  52. package/dist/properties/namedProperty.js +7 -5
  53. package/dist/properties/namedProperty.js.map +1 -1
  54. package/dist/properties/nodeProperty.d.ts.map +1 -1
  55. package/dist/properties/nodeProperty.js +5 -3
  56. package/dist/properties/nodeProperty.js.map +1 -1
  57. package/dist/properties/primitiveTypeCasts.d.ts.map +1 -1
  58. package/dist/properties/primitiveTypeCasts.js +9 -9
  59. package/dist/properties/primitiveTypeCasts.js.map +1 -1
  60. package/dist/properties/referenceArrayProperty.d.ts.map +1 -1
  61. package/dist/properties/referenceArrayProperty.js +31 -25
  62. package/dist/properties/referenceArrayProperty.js.map +1 -1
  63. package/dist/properties/referenceMapProperty.d.ts.map +1 -1
  64. package/dist/properties/referenceMapProperty.js +18 -18
  65. package/dist/properties/referenceMapProperty.js.map +1 -1
  66. package/dist/properties/referenceProperty.d.ts.map +1 -1
  67. package/dist/properties/referenceProperty.js +33 -29
  68. package/dist/properties/referenceProperty.js.map +1 -1
  69. package/dist/properties/setProperty.d.ts.map +1 -1
  70. package/dist/properties/setProperty.js +31 -29
  71. package/dist/properties/setProperty.js.map +1 -1
  72. package/dist/properties/stringProperty.d.ts.map +1 -1
  73. package/dist/properties/stringProperty.js +56 -40
  74. package/dist/properties/stringProperty.js.map +1 -1
  75. package/dist/properties/uintProperties.js +5 -5
  76. package/dist/properties/uintProperties.js.map +1 -1
  77. package/dist/properties/valueArrayProperty.d.ts +1 -1
  78. package/dist/properties/valueArrayProperty.d.ts.map +1 -1
  79. package/dist/properties/valueArrayProperty.js +30 -29
  80. package/dist/properties/valueArrayProperty.js.map +1 -1
  81. package/dist/properties/valueMapProperty.d.ts.map +1 -1
  82. package/dist/properties/valueMapProperty.js +31 -29
  83. package/dist/properties/valueMapProperty.js.map +1 -1
  84. package/dist/properties/valueProperty.d.ts.map +1 -1
  85. package/dist/properties/valueProperty.js +11 -9
  86. package/dist/properties/valueProperty.js.map +1 -1
  87. package/dist/propertyFactory.d.ts.map +1 -1
  88. package/dist/propertyFactory.js +309 -252
  89. package/dist/propertyFactory.js.map +1 -1
  90. package/dist/propertyTemplate.d.ts +17 -17
  91. package/dist/propertyTemplate.d.ts.map +1 -1
  92. package/dist/propertyTemplate.js +64 -45
  93. package/dist/propertyTemplate.js.map +1 -1
  94. package/dist/propertyTemplateWrapper.d.ts.map +1 -1
  95. package/dist/propertyTemplateWrapper.js +40 -25
  96. package/dist/propertyTemplateWrapper.js.map +1 -1
  97. package/dist/propertyUtils.d.ts.map +1 -1
  98. package/dist/propertyUtils.js.map +1 -1
  99. package/dist/test/properties/arrayProperty.spec.js +566 -490
  100. package/dist/test/properties/arrayProperty.spec.js.map +1 -1
  101. package/dist/test/properties/baseProperty.spec.js +293 -280
  102. package/dist/test/properties/baseProperty.spec.js.map +1 -1
  103. package/dist/test/properties/containerProperty.spec.js +100 -94
  104. package/dist/test/properties/containerProperty.spec.js.map +1 -1
  105. package/dist/test/properties/customArrayProperty.spec.js +174 -147
  106. package/dist/test/properties/customArrayProperty.spec.js.map +1 -1
  107. package/dist/test/properties/enumArrayProperty.spec.js +67 -63
  108. package/dist/test/properties/enumArrayProperty.spec.js.map +1 -1
  109. package/dist/test/properties/enumProperty.spec.js +115 -97
  110. package/dist/test/properties/enumProperty.spec.js.map +1 -1
  111. package/dist/test/properties/float32.spec.js +5 -5
  112. package/dist/test/properties/float32.spec.js.map +1 -1
  113. package/dist/test/properties/int64ArrayProperty.spec.js +157 -93
  114. package/dist/test/properties/int64ArrayProperty.spec.js.map +1 -1
  115. package/dist/test/properties/int64MapProperty.spec.js +185 -166
  116. package/dist/test/properties/int64MapProperty.spec.js.map +1 -1
  117. package/dist/test/properties/int64Property.spec.js +109 -109
  118. package/dist/test/properties/int64Property.spec.js.map +1 -1
  119. package/dist/test/properties/isLeafNode.spec.js +75 -76
  120. package/dist/test/properties/isLeafNode.spec.js.map +1 -1
  121. package/dist/test/properties/mapProperty.spec.js +571 -531
  122. package/dist/test/properties/mapProperty.spec.js.map +1 -1
  123. package/dist/test/properties/namedNodeProperty.spec.js +31 -31
  124. package/dist/test/properties/namedNodeProperty.spec.js.map +1 -1
  125. package/dist/test/properties/nodeProperty.spec.js +805 -795
  126. package/dist/test/properties/nodeProperty.spec.js.map +1 -1
  127. package/dist/test/properties/referenceProperty.spec.js +729 -679
  128. package/dist/test/properties/referenceProperty.spec.js.map +1 -1
  129. package/dist/test/properties/relationshipProperty.spec.js +16 -16
  130. package/dist/test/properties/relationshipProperty.spec.js.map +1 -1
  131. package/dist/test/properties/setProperty.spec.js +288 -227
  132. package/dist/test/properties/setProperty.spec.js.map +1 -1
  133. package/dist/test/properties/stringProperty.spec.js +326 -318
  134. package/dist/test/properties/stringProperty.spec.js.map +1 -1
  135. package/dist/test/properties/uint64Property.spec.js +46 -36
  136. package/dist/test/properties/uint64Property.spec.js.map +1 -1
  137. package/dist/test/properties/valueMapProperty.spec.js +259 -246
  138. package/dist/test/properties/valueMapProperty.spec.js.map +1 -1
  139. package/dist/test/properties/valueProperty.spec.js +49 -43
  140. package/dist/test/properties/valueProperty.spec.js.map +1 -1
  141. package/dist/test/propertyFactory.spec.js +2038 -1631
  142. package/dist/test/propertyFactory.spec.js.map +1 -1
  143. package/dist/test/propertyTemplateWrapper.spec.js +72 -102
  144. package/dist/test/propertyTemplateWrapper.spec.js.map +1 -1
  145. package/dist/test/propertyUtils.spec.js +22 -21
  146. package/dist/test/propertyUtils.spec.js.map +1 -1
  147. package/dist/test/reversibleChangeset.spec.js +857 -703
  148. package/dist/test/reversibleChangeset.spec.js.map +1 -1
  149. package/dist/test/setup.js +5 -5
  150. package/dist/test/setup.js.map +1 -1
  151. package/dist/test/tsconfig.tsbuildinfo +1 -1
  152. package/dist/test/utils.spec.js +1334 -1144
  153. package/dist/test/utils.spec.js.map +1 -1
  154. package/dist/test/validation/badMissingSemverInTypeid.js +20 -20
  155. package/dist/test/validation/badMissingSemverInTypeid.js.map +1 -1
  156. package/dist/test/validation/badPrimitiveTypeid.js +12 -12
  157. package/dist/test/validation/badPrimitiveTypeid.js.map +1 -1
  158. package/dist/test/validation/goodColorId.js +91 -91
  159. package/dist/test/validation/goodColorId.js.map +1 -1
  160. package/dist/test/validation/goodColorPalette.js +4 -4
  161. package/dist/test/validation/goodColorPalette.js.map +1 -1
  162. package/dist/test/validation/goodPointId.js +20 -20
  163. package/dist/test/validation/goodPointId.js.map +1 -1
  164. package/dist/test/validation/reversibleChangeSetTestData.js +23841 -2
  165. package/dist/test/validation/reversibleChangeSetTestData.js.map +1 -1
  166. package/lib/containerSerializer.d.ts.map +1 -1
  167. package/lib/containerSerializer.js +5 -5
  168. package/lib/containerSerializer.js.map +1 -1
  169. package/lib/enableValidations.js.map +1 -1
  170. package/lib/index.d.ts +19 -19
  171. package/lib/index.d.ts.map +1 -1
  172. package/lib/index.js +19 -19
  173. package/lib/index.js.map +1 -1
  174. package/lib/properties/abstractStaticCollectionProperty.d.ts +10 -10
  175. package/lib/properties/abstractStaticCollectionProperty.d.ts.map +1 -1
  176. package/lib/properties/abstractStaticCollectionProperty.js +70 -53
  177. package/lib/properties/abstractStaticCollectionProperty.js.map +1 -1
  178. package/lib/properties/arrayProperty.d.ts.map +1 -1
  179. package/lib/properties/arrayProperty.js +152 -103
  180. package/lib/properties/arrayProperty.js.map +1 -1
  181. package/lib/properties/baseProperty.d.ts +4 -4
  182. package/lib/properties/baseProperty.d.ts.map +1 -1
  183. package/lib/properties/baseProperty.js +73 -51
  184. package/lib/properties/baseProperty.js.map +1 -1
  185. package/lib/properties/boolProperty.d.ts.map +1 -1
  186. package/lib/properties/boolProperty.js +3 -3
  187. package/lib/properties/boolProperty.js.map +1 -1
  188. package/lib/properties/containerProperty.d.ts +8 -8
  189. package/lib/properties/containerProperty.d.ts.map +1 -1
  190. package/lib/properties/containerProperty.js +33 -26
  191. package/lib/properties/containerProperty.js.map +1 -1
  192. package/lib/properties/enumArrayProperty.d.ts.map +1 -1
  193. package/lib/properties/enumArrayProperty.js +14 -14
  194. package/lib/properties/enumArrayProperty.js.map +1 -1
  195. package/lib/properties/enumProperty.d.ts.map +1 -1
  196. package/lib/properties/enumProperty.js +17 -17
  197. package/lib/properties/enumProperty.js.map +1 -1
  198. package/lib/properties/floatProperties.js +4 -4
  199. package/lib/properties/floatProperties.js.map +1 -1
  200. package/lib/properties/index.d.ts +23 -23
  201. package/lib/properties/index.d.ts.map +1 -1
  202. package/lib/properties/index.js +23 -23
  203. package/lib/properties/index.js.map +1 -1
  204. package/lib/properties/indexedCollectionBaseProperty.d.ts.map +1 -1
  205. package/lib/properties/indexedCollectionBaseProperty.js +47 -37
  206. package/lib/properties/indexedCollectionBaseProperty.js.map +1 -1
  207. package/lib/properties/intProperties.d.ts.map +1 -1
  208. package/lib/properties/intProperties.js +10 -10
  209. package/lib/properties/intProperties.js.map +1 -1
  210. package/lib/properties/lazyLoadedProperties.js.map +1 -1
  211. package/lib/properties/mapProperty.d.ts.map +1 -1
  212. package/lib/properties/mapProperty.js +21 -17
  213. package/lib/properties/mapProperty.js.map +1 -1
  214. package/lib/properties/namedNodeProperty.d.ts.map +1 -1
  215. package/lib/properties/namedNodeProperty.js +3 -3
  216. package/lib/properties/namedNodeProperty.js.map +1 -1
  217. package/lib/properties/namedProperty.d.ts.map +1 -1
  218. package/lib/properties/namedProperty.js +7 -5
  219. package/lib/properties/namedProperty.js.map +1 -1
  220. package/lib/properties/nodeProperty.d.ts.map +1 -1
  221. package/lib/properties/nodeProperty.js +5 -3
  222. package/lib/properties/nodeProperty.js.map +1 -1
  223. package/lib/properties/primitiveTypeCasts.d.ts.map +1 -1
  224. package/lib/properties/primitiveTypeCasts.js +9 -9
  225. package/lib/properties/primitiveTypeCasts.js.map +1 -1
  226. package/lib/properties/referenceArrayProperty.d.ts.map +1 -1
  227. package/lib/properties/referenceArrayProperty.js +31 -25
  228. package/lib/properties/referenceArrayProperty.js.map +1 -1
  229. package/lib/properties/referenceMapProperty.d.ts.map +1 -1
  230. package/lib/properties/referenceMapProperty.js +18 -18
  231. package/lib/properties/referenceMapProperty.js.map +1 -1
  232. package/lib/properties/referenceProperty.d.ts.map +1 -1
  233. package/lib/properties/referenceProperty.js +33 -29
  234. package/lib/properties/referenceProperty.js.map +1 -1
  235. package/lib/properties/setProperty.d.ts.map +1 -1
  236. package/lib/properties/setProperty.js +31 -29
  237. package/lib/properties/setProperty.js.map +1 -1
  238. package/lib/properties/stringProperty.d.ts.map +1 -1
  239. package/lib/properties/stringProperty.js +56 -40
  240. package/lib/properties/stringProperty.js.map +1 -1
  241. package/lib/properties/uintProperties.js +5 -5
  242. package/lib/properties/uintProperties.js.map +1 -1
  243. package/lib/properties/valueArrayProperty.d.ts +1 -1
  244. package/lib/properties/valueArrayProperty.d.ts.map +1 -1
  245. package/lib/properties/valueArrayProperty.js +30 -29
  246. package/lib/properties/valueArrayProperty.js.map +1 -1
  247. package/lib/properties/valueMapProperty.d.ts.map +1 -1
  248. package/lib/properties/valueMapProperty.js +31 -29
  249. package/lib/properties/valueMapProperty.js.map +1 -1
  250. package/lib/properties/valueProperty.d.ts.map +1 -1
  251. package/lib/properties/valueProperty.js +11 -9
  252. package/lib/properties/valueProperty.js.map +1 -1
  253. package/lib/propertyFactory.d.ts.map +1 -1
  254. package/lib/propertyFactory.js +309 -252
  255. package/lib/propertyFactory.js.map +1 -1
  256. package/lib/propertyTemplate.d.ts +17 -17
  257. package/lib/propertyTemplate.d.ts.map +1 -1
  258. package/lib/propertyTemplate.js +64 -45
  259. package/lib/propertyTemplate.js.map +1 -1
  260. package/lib/propertyTemplateWrapper.d.ts.map +1 -1
  261. package/lib/propertyTemplateWrapper.js +40 -25
  262. package/lib/propertyTemplateWrapper.js.map +1 -1
  263. package/lib/propertyUtils.d.ts.map +1 -1
  264. package/lib/propertyUtils.js.map +1 -1
  265. package/package.json +28 -28
  266. package/src/index.d.ts +2750 -2681
@@ -6,103 +6,97 @@
6
6
  /**
7
7
  * @fileoverview In this file, we will test the NodeProperty object described in properties/nodeProperty.js
8
8
  */
9
- const { ChangeSet } = require('@fluid-experimental/property-changeset');
10
- const { generateGUID } = require('@fluid-experimental/property-common').GuidUtils;
11
- const { MSG } = require('@fluid-experimental/property-common').constants;
12
- const _ = require('lodash');
13
- const { PropertyFactory } = require('../..');
14
- const { BaseProperty } = require('../..');
15
- const { NodeProperty } = require('../../properties/nodeProperty');
16
- const { MapProperty } = require('../../properties/mapProperty');
17
- describe('NodeProperty', function () {
9
+ const { ChangeSet } = require("@fluid-experimental/property-changeset");
10
+ const { generateGUID } = require("@fluid-experimental/property-common").GuidUtils;
11
+ const { MSG } = require("@fluid-experimental/property-common").constants;
12
+ const _ = require("lodash");
13
+ const { PropertyFactory } = require("../..");
14
+ const { BaseProperty } = require("../..");
15
+ const { NodeProperty } = require("../../properties/nodeProperty");
16
+ const { MapProperty } = require("../../properties/mapProperty");
17
+ describe("NodeProperty", function () {
18
18
  var changeSetWithTwoMapEntries, changeSetWithTwoMapEntries_full, removalChangeSet;
19
19
  var myNode, mapNode1, mapNode2;
20
20
  before(function () {
21
21
  // Register a template with a set property for the tests
22
22
  var MixedNodePropertyTemplate = {
23
- typeid: 'autodesk.tests:MixedNodeTestProperty-1.0.0',
24
- inherits: ['NodeProperty'],
23
+ typeid: "autodesk.tests:MixedNodeTestProperty-1.0.0",
24
+ inherits: ["NodeProperty"],
25
25
  properties: [
26
- { id: 'stringProperty', typeid: 'String' },
27
- { id: 'stringProperty2', typeid: 'String' },
26
+ { id: "stringProperty", typeid: "String" },
27
+ { id: "stringProperty2", typeid: "String" },
28
28
  ],
29
29
  };
30
30
  var AnonymousTestPropertyTemplate = {
31
- typeid: 'autodesk.tests:AnonymousProperty-1.0.0',
32
- properties: [
33
- { id: 'stringProperty', typeid: 'String' },
34
- ],
31
+ typeid: "autodesk.tests:AnonymousProperty-1.0.0",
32
+ properties: [{ id: "stringProperty", typeid: "String" }],
35
33
  };
36
34
  var MixedNamedNodePropertyTemplate = {
37
- typeid: 'autodesk.tests:MixedNamedNodeProperty-1.0.0',
38
- inherits: ['NodeProperty', 'NamedProperty'],
39
- properties: [
40
- { id: 'stringProperty', typeid: 'String' },
41
- ],
35
+ typeid: "autodesk.tests:MixedNamedNodeProperty-1.0.0",
36
+ inherits: ["NodeProperty", "NamedProperty"],
37
+ properties: [{ id: "stringProperty", typeid: "String" }],
42
38
  };
43
39
  var TestEnumTemplate = {
44
- typeid: 'autodesk.core:UnitsEnum-1.0.0',
45
- inherits: 'Enum',
46
- annotation: { description: 'The metric units' },
40
+ typeid: "autodesk.core:UnitsEnum-1.0.0",
41
+ inherits: "Enum",
42
+ annotation: { description: "The metric units" },
47
43
  properties: [
48
- { id: 'm', value: 1, annotation: { description: 'meter' } },
49
- { id: 'cm', value: 2, annotation: { description: 'centimeter' } },
50
- { id: 'mm', value: 3, annotation: { description: 'millimeter' } },
44
+ { id: "m", value: 1, annotation: { description: "meter" } },
45
+ { id: "cm", value: 2, annotation: { description: "centimeter" } },
46
+ { id: "mm", value: 3, annotation: { description: "millimeter" } },
51
47
  ],
52
48
  };
53
49
  PropertyFactory._reregister(TestEnumTemplate);
54
50
  PropertyFactory._reregister(MixedNodePropertyTemplate);
55
51
  PropertyFactory._reregister(MixedNamedNodePropertyTemplate);
56
52
  PropertyFactory._reregister(AnonymousTestPropertyTemplate);
57
- myNode = PropertyFactory.create('NodeProperty');
58
- mapNode1 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
59
- mapNode2 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
53
+ myNode = PropertyFactory.create("NodeProperty");
54
+ mapNode1 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
55
+ mapNode2 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
60
56
  // Register the templates from the discussion document
61
57
  var Vec3Template = {
62
- typeid: 'autodesk.test:vector3-1.0.0',
58
+ typeid: "autodesk.test:vector3-1.0.0",
63
59
  properties: [
64
- { id: 'x', typeid: 'Float32' },
65
- { id: 'y', typeid: 'Float32' },
66
- { id: 'z', typeid: 'Float32' },
60
+ { id: "x", typeid: "Float32" },
61
+ { id: "y", typeid: "Float32" },
62
+ { id: "z", typeid: "Float32" },
67
63
  ],
68
64
  };
69
65
  var Point2DTemplate = {
70
- typeid: 'autodesk.test:point2d-1.0.0',
66
+ typeid: "autodesk.test:point2d-1.0.0",
71
67
  properties: [
72
68
  {
73
- id: 'position', properties: [
74
- { id: 'x', typeid: 'Float32' },
75
- { id: 'y', typeid: 'Float32' },
69
+ id: "position",
70
+ properties: [
71
+ { id: "x", typeid: "Float32" },
72
+ { id: "y", typeid: "Float32" },
76
73
  ],
77
74
  },
78
- { id: 'normal', typeid: 'autodesk.test:vector3-1.0.0' },
79
- { id: 'neighbours', typeid: 'autodesk.test:vector3-1.0.0', context: 'map' },
80
- { id: 'temperature', typeid: 'Float32' },
75
+ { id: "normal", typeid: "autodesk.test:vector3-1.0.0" },
76
+ { id: "neighbours", typeid: "autodesk.test:vector3-1.0.0", context: "map" },
77
+ { id: "temperature", typeid: "Float32" },
81
78
  ],
82
79
  };
83
80
  var SceneObjectTemplate = {
84
- inherits: 'NodeProperty',
85
- typeid: 'autodesk.test:SceneObject-1.0.0',
81
+ inherits: "NodeProperty",
82
+ typeid: "autodesk.test:SceneObject-1.0.0",
86
83
  properties: [
87
- { id: 'name', typeid: 'String' },
88
- { id: 'revitId', typeid: 'String' },
84
+ { id: "name", typeid: "String" },
85
+ { id: "revitId", typeid: "String" },
89
86
  ],
90
87
  };
91
88
  var nestedNodeProperty = {
92
- typeid: 'autodesk.tests:nested.node.property-1.0.0',
89
+ typeid: "autodesk.tests:nested.node.property-1.0.0",
93
90
  properties: [
94
91
  {
95
- id: 'nested', properties: [
96
- { id: 'property', typeid: 'NodeProperty' },
97
- ],
92
+ id: "nested",
93
+ properties: [{ id: "property", typeid: "NodeProperty" }],
98
94
  },
99
95
  ],
100
96
  };
101
97
  var testArrayProperty = {
102
- typeid: 'autodesk.tests:test.array.property-1.0.0',
103
- properties: [
104
- { id: 'array', typeid: 'Float32', context: 'array' },
105
- ],
98
+ typeid: "autodesk.tests:test.array.property-1.0.0",
99
+ properties: [{ id: "array", typeid: "Float32", context: "array" }],
106
100
  };
107
101
  PropertyFactory._reregister(Vec3Template);
108
102
  PropertyFactory._reregister(Point2DTemplate);
@@ -117,9 +111,9 @@ describe('NodeProperty', function () {
117
111
  };
118
112
  // Inserts a node with the given guid (a new one is generated when undefined)
119
113
  var insertNodeInRootWithKeyAndGuid = function (key, guid, root) {
120
- var node = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
114
+ var node = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
121
115
  if (key === undefined) {
122
- key = 'node' + keyCounter++;
116
+ key = "node" + keyCounter++;
123
117
  }
124
118
  root.insert(key, node);
125
119
  };
@@ -129,7 +123,7 @@ describe('NodeProperty', function () {
129
123
  };
130
124
  // Returns a functor that will insert a node with a constant GUID
131
125
  var insertUniqueNodeInRoot = function () {
132
- var key = 'node' + keyCounter++;
126
+ var key = "node" + keyCounter++;
133
127
  return insertNodeInRootWithKeyAndGuid.bind(undefined, key, generateGUID());
134
128
  };
135
129
  // Inserts a new node as leaf
@@ -138,8 +132,8 @@ describe('NodeProperty', function () {
138
132
  while (leaf.getDynamicIds().length > 0) {
139
133
  leaf = _.values(leaf._getDynamicChildrenReadOnly())[0];
140
134
  }
141
- var node = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
142
- var key = 'node' + keyCounter++;
135
+ var node = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
136
+ var key = "node" + keyCounter++;
143
137
  leaf.insert(key, node);
144
138
  };
145
139
  // Removes the first node from the root
@@ -153,162 +147,162 @@ describe('NodeProperty', function () {
153
147
  while (leaf.getDynamicIds().length > 0) {
154
148
  leaf = _.values(leaf._getDynamicChildrenReadOnly())[0];
155
149
  }
156
- leaf._properties.stringProperty.value = leaf._properties.stringProperty.value + '+';
150
+ leaf._properties.stringProperty.value = leaf._properties.stringProperty.value + "+";
157
151
  };
158
- describe('Testing creation, assignment and serialization', function () {
159
- it('should be empty at the beginning', function () {
152
+ describe("Testing creation, assignment and serialization", function () {
153
+ it("should be empty at the beginning", function () {
160
154
  expect(myNode.getIds()).to.be.empty;
161
- expect(myNode.serialize({ 'dirtyOnly': true })).to.be.empty;
155
+ expect(myNode.serialize({ dirtyOnly: true })).to.be.empty;
162
156
  });
163
- it('should be possible to insert into the map', function () {
157
+ it("should be possible to insert into the map", function () {
164
158
  // Test insertion of the first node
165
- myNode.insert('node1', mapNode1);
166
- expect(myNode.has('node1')).to.be.ok;
167
- expect(myNode.has('node2')).to.be.not.ok;
168
- expect(myNode.get('node2')).to.equal(undefined);
159
+ myNode.insert("node1", mapNode1);
160
+ expect(myNode.has("node1")).to.be.ok;
161
+ expect(myNode.has("node2")).to.be.not.ok;
162
+ expect(myNode.get("node2")).to.equal(undefined);
169
163
  expect(mapNode1.getParent()).to.equal(myNode);
170
- var CS = myNode.serialize({ 'dirtyOnly': true });
164
+ var CS = myNode.serialize({ dirtyOnly: true });
171
165
  expect(CS.insert &&
172
- CS.insert['autodesk.tests:MixedNodeTestProperty-1.0.0'] &&
173
- _.keys(CS.insert['autodesk.tests:MixedNodeTestProperty-1.0.0']).length === 1 &&
174
- _.keys(CS.insert['autodesk.tests:MixedNodeTestProperty-1.0.0'])[0] === 'node1').to.be.ok;
166
+ CS.insert["autodesk.tests:MixedNodeTestProperty-1.0.0"] &&
167
+ _.keys(CS.insert["autodesk.tests:MixedNodeTestProperty-1.0.0"]).length === 1 &&
168
+ _.keys(CS.insert["autodesk.tests:MixedNodeTestProperty-1.0.0"])[0] === "node1").to.be.ok;
175
169
  // Test insertion of the second node
176
- myNode.insert('node2', mapNode2);
177
- expect(myNode.has('node2')).to.be.ok;
178
- expect(myNode.get('node2')).to.equal(mapNode2);
179
- changeSetWithTwoMapEntries = myNode.serialize({ 'dirtyOnly': true });
170
+ myNode.insert("node2", mapNode2);
171
+ expect(myNode.has("node2")).to.be.ok;
172
+ expect(myNode.get("node2")).to.equal(mapNode2);
173
+ changeSetWithTwoMapEntries = myNode.serialize({ dirtyOnly: true });
180
174
  expect(changeSetWithTwoMapEntries.insert &&
181
- changeSetWithTwoMapEntries.insert['autodesk.tests:MixedNodeTestProperty-1.0.0'] &&
182
- _.keys(changeSetWithTwoMapEntries.insert['autodesk.tests:MixedNodeTestProperty-1.0.0']).length === 2 &&
183
- _.includes(_.keys(changeSetWithTwoMapEntries.insert['autodesk.tests:MixedNodeTestProperty-1.0.0']), 'node1') &&
184
- _.includes(_.keys(changeSetWithTwoMapEntries.insert['autodesk.tests:MixedNodeTestProperty-1.0.0']), 'node2')).to.be.ok;
185
- changeSetWithTwoMapEntries_full = myNode.serialize({ 'dirtyOnly': false });
175
+ changeSetWithTwoMapEntries.insert["autodesk.tests:MixedNodeTestProperty-1.0.0"] &&
176
+ _.keys(changeSetWithTwoMapEntries.insert["autodesk.tests:MixedNodeTestProperty-1.0.0"]).length === 2 &&
177
+ _.includes(_.keys(changeSetWithTwoMapEntries.insert["autodesk.tests:MixedNodeTestProperty-1.0.0"]), "node1") &&
178
+ _.includes(_.keys(changeSetWithTwoMapEntries.insert["autodesk.tests:MixedNodeTestProperty-1.0.0"]), "node2")).to.be.ok;
179
+ changeSetWithTwoMapEntries_full = myNode.serialize({ dirtyOnly: false });
186
180
  expect(changeSetWithTwoMapEntries).to.deep.equal(changeSetWithTwoMapEntries_full);
187
181
  });
188
- it('should fail when trying to insert with empty id', function () {
189
- var myNode1 = PropertyFactory.create('NodeProperty');
190
- var mapNode3 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
191
- expect(() => myNode1.insert('', mapNode3)).to.throw(MSG.ID_SHOULD_NOT_BE_EMPTY_STRING);
192
- });
193
- it('should fail when trying to insert in itself', function () {
194
- var myNode1 = PropertyFactory.create('NodeProperty');
195
- expect(() => myNode1.insert('a', myNode1)).to.throw(MSG.INSERTED_IN_OWN_CHILDREN);
196
- });
197
- it('should fail when trying to insert in child', function () {
198
- var myNodeParent = PropertyFactory.create('NodeProperty');
199
- var myNodeChild = PropertyFactory.create('NodeProperty');
200
- myNodeParent.insert('a', myNodeChild);
201
- expect(() => myNodeChild.insert('a', myNodeParent)).to.throw(MSG.INSERTED_IN_OWN_CHILDREN);
202
- });
203
- it('should fail when trying to insert in grand-child', function () {
204
- var myNodeParent = PropertyFactory.create('NodeProperty');
205
- var myNodeChild = PropertyFactory.create('NodeProperty');
206
- var myNodeGrandChild = PropertyFactory.create('NodeProperty');
207
- myNodeParent.insert('a', myNodeChild);
208
- myNodeChild.insert('a', myNodeGrandChild);
209
- expect(() => myNodeGrandChild.insert('a', myNodeParent)).to.throw(MSG.INSERTED_IN_OWN_CHILDREN);
210
- });
211
- it('.remove should return the property removed', function () {
212
- var myNode1 = PropertyFactory.create('NodeProperty');
213
- var mapNode3 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
214
- var mapNode4 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
215
- myNode1.insert('node1', mapNode3);
216
- myNode1.insert('node2', mapNode4);
217
- expect(myNode1.remove('node1')).to.deep.equal(mapNode3);
182
+ it("should fail when trying to insert with empty id", function () {
183
+ var myNode1 = PropertyFactory.create("NodeProperty");
184
+ var mapNode3 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
185
+ expect(() => myNode1.insert("", mapNode3)).to.throw(MSG.ID_SHOULD_NOT_BE_EMPTY_STRING);
186
+ });
187
+ it("should fail when trying to insert in itself", function () {
188
+ var myNode1 = PropertyFactory.create("NodeProperty");
189
+ expect(() => myNode1.insert("a", myNode1)).to.throw(MSG.INSERTED_IN_OWN_CHILDREN);
190
+ });
191
+ it("should fail when trying to insert in child", function () {
192
+ var myNodeParent = PropertyFactory.create("NodeProperty");
193
+ var myNodeChild = PropertyFactory.create("NodeProperty");
194
+ myNodeParent.insert("a", myNodeChild);
195
+ expect(() => myNodeChild.insert("a", myNodeParent)).to.throw(MSG.INSERTED_IN_OWN_CHILDREN);
196
+ });
197
+ it("should fail when trying to insert in grand-child", function () {
198
+ var myNodeParent = PropertyFactory.create("NodeProperty");
199
+ var myNodeChild = PropertyFactory.create("NodeProperty");
200
+ var myNodeGrandChild = PropertyFactory.create("NodeProperty");
201
+ myNodeParent.insert("a", myNodeChild);
202
+ myNodeChild.insert("a", myNodeGrandChild);
203
+ expect(() => myNodeGrandChild.insert("a", myNodeParent)).to.throw(MSG.INSERTED_IN_OWN_CHILDREN);
204
+ });
205
+ it(".remove should return the property removed", function () {
206
+ var myNode1 = PropertyFactory.create("NodeProperty");
207
+ var mapNode3 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
208
+ var mapNode4 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
209
+ myNode1.insert("node1", mapNode3);
210
+ myNode1.insert("node2", mapNode4);
211
+ expect(myNode1.remove("node1")).to.deep.equal(mapNode3);
218
212
  expect(myNode1.remove(mapNode4)).to.deep.equal(mapNode4);
219
213
  expect(myNode1.getIds()).to.be.empty;
220
214
  });
221
- it('.clear should remove all nodes', function () {
222
- var myNode1 = PropertyFactory.create('NodeProperty');
223
- var mapNode3 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
224
- var mapNode4 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
225
- myNode1.insert('node1', mapNode3);
226
- myNode1.insert('node2', mapNode4);
215
+ it(".clear should remove all nodes", function () {
216
+ var myNode1 = PropertyFactory.create("NodeProperty");
217
+ var mapNode3 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
218
+ var mapNode4 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
219
+ myNode1.insert("node1", mapNode3);
220
+ myNode1.insert("node2", mapNode4);
227
221
  expect(myNode1.clear()).to.be.undefined;
228
222
  expect(myNode1.getIds()).to.be.empty;
229
223
  });
230
- it('.getValues should work', function () {
231
- var myNode1 = PropertyFactory.create('NodeProperty');
232
- var mapNode3 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
233
- var mapNode4 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
234
- myNode1.insert('node1', mapNode3);
235
- myNode1.insert('node2', mapNode4);
224
+ it(".getValues should work", function () {
225
+ var myNode1 = PropertyFactory.create("NodeProperty");
226
+ var mapNode3 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
227
+ var mapNode4 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
228
+ myNode1.insert("node1", mapNode3);
229
+ myNode1.insert("node2", mapNode4);
236
230
  expect(myNode1.getValues()).to.deep.equal({
237
- node1: { stringProperty: '', stringProperty2: '' },
238
- node2: { stringProperty: '', stringProperty2: '' },
231
+ node1: { stringProperty: "", stringProperty2: "" },
232
+ node2: { stringProperty: "", stringProperty2: "" },
239
233
  });
240
234
  });
241
- it('getValues should work with nested arrays', function () {
242
- var myNode1 = PropertyFactory.create('NodeProperty');
243
- var myArray = PropertyFactory.create('autodesk.tests:test.array.property-1.0.0');
244
- myNode1.insert('array1', myArray);
245
- myNode1.get('array1').get('array').insertRange(0, [1, 2, 3]);
246
- expect(myNode1.getIds()).to.deep.equal(['array1']);
235
+ it("getValues should work with nested arrays", function () {
236
+ var myNode1 = PropertyFactory.create("NodeProperty");
237
+ var myArray = PropertyFactory.create("autodesk.tests:test.array.property-1.0.0");
238
+ myNode1.insert("array1", myArray);
239
+ myNode1.get("array1").get("array").insertRange(0, [1, 2, 3]);
240
+ expect(myNode1.getIds()).to.deep.equal(["array1"]);
247
241
  expect(myNode1.getValues()).to.deep.equal({
248
242
  array1: { array: [1, 2, 3] },
249
243
  });
250
244
  });
251
- it.skip('@bugfix getValues should work with circular references', function () {
252
- var myNode1 = PropertyFactory.create('NodeProperty');
253
- var myRef1 = PropertyFactory.create('Reference', 'single', '/ref2');
254
- var myRef2 = PropertyFactory.create('Reference', 'single', '/ref1');
255
- myNode1.insert('ref1', myRef1);
256
- myNode1.insert('ref2', myRef2);
245
+ it.skip("@bugfix getValues should work with circular references", function () {
246
+ var myNode1 = PropertyFactory.create("NodeProperty");
247
+ var myRef1 = PropertyFactory.create("Reference", "single", "/ref2");
248
+ var myRef2 = PropertyFactory.create("Reference", "single", "/ref1");
249
+ myNode1.insert("ref1", myRef1);
250
+ myNode1.insert("ref2", myRef2);
257
251
  myNode1.getValues();
258
- expect(myNode1.getIds()).to.deep.equal(['ref1', 'ref2']);
252
+ expect(myNode1.getIds()).to.deep.equal(["ref1", "ref2"]);
259
253
  expect(myNode1.getValues()).to.deep.equal({
260
- 'ref1': '/ref2',
261
- 'ref2': '/ref1',
254
+ ref1: "/ref2",
255
+ ref2: "/ref1",
262
256
  });
263
257
  });
264
- it('getValues should work with bad references', function () {
265
- var myNode1 = PropertyFactory.create('NodeProperty');
266
- var myRef = PropertyFactory.create('Reference', 'single');
267
- myNode1.insert('badref', myRef);
258
+ it("getValues should work with bad references", function () {
259
+ var myNode1 = PropertyFactory.create("NodeProperty");
260
+ var myRef = PropertyFactory.create("Reference", "single");
261
+ myNode1.insert("badref", myRef);
268
262
  myNode1.getValues();
269
- expect(myNode1.getIds()).to.deep.equal(['badref']);
263
+ expect(myNode1.getIds()).to.deep.equal(["badref"]);
270
264
  expect(myNode1.getValues()).to.deep.equal({
271
- 'badref': undefined,
265
+ badref: undefined,
272
266
  });
273
267
  });
274
- it('Should track dirtiness', function () {
268
+ it("Should track dirtiness", function () {
275
269
  myNode.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY);
276
270
  expect(myNode.serialize({
277
- 'dirtyOnly': true,
278
- 'includeRootTypeid': false,
279
- 'dirtinessType': BaseProperty.MODIFIED_STATE_FLAGS.DIRTY,
271
+ dirtyOnly: true,
272
+ includeRootTypeid: false,
273
+ dirtinessType: BaseProperty.MODIFIED_STATE_FLAGS.DIRTY,
280
274
  })).to.be.empty;
281
275
  expect(myNode.serialize({
282
- 'dirtyOnly': true,
283
- 'includeRootTypeid': false,
284
- 'dirtinessType': BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE,
276
+ dirtyOnly: true,
277
+ includeRootTypeid: false,
278
+ dirtinessType: BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE,
285
279
  })).deep.equal(changeSetWithTwoMapEntries_full);
286
- expect(myNode.serialize({ 'dirtyOnly': false })).deep.equal(changeSetWithTwoMapEntries_full);
280
+ expect(myNode.serialize({ dirtyOnly: false })).deep.equal(changeSetWithTwoMapEntries_full);
287
281
  });
288
- it('Should handle removals correctly', function () {
289
- myNode.remove('node1');
282
+ it("Should handle removals correctly", function () {
283
+ myNode.remove("node1");
290
284
  expect(mapNode1.getParent()).to.be.undefined;
291
- myNode.remove('node2');
285
+ myNode.remove("node2");
292
286
  expect(myNode.serialize({
293
- 'dirtyOnly': true,
294
- 'includeRootTypeid': false,
295
- 'dirtinessType': BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE,
287
+ dirtyOnly: true,
288
+ includeRootTypeid: false,
289
+ dirtinessType: BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE,
296
290
  })).to.be.empty;
297
- expect(myNode.serialize({ 'dirtyOnly': false })).to.be.empty;
291
+ expect(myNode.serialize({ dirtyOnly: false })).to.be.empty;
298
292
  removalChangeSet = myNode.serialize({
299
- 'dirtyOnly': true,
300
- 'includeRootTypeid': false,
301
- 'dirtinessType': BaseProperty.MODIFIED_STATE_FLAGS.DIRTY,
293
+ dirtyOnly: true,
294
+ includeRootTypeid: false,
295
+ dirtinessType: BaseProperty.MODIFIED_STATE_FLAGS.DIRTY,
302
296
  });
303
- expect(removalChangeSet).to.have.all.keys(['remove']);
297
+ expect(removalChangeSet).to.have.all.keys(["remove"]);
304
298
  expect(removalChangeSet.remove).to.have.length(2);
305
- expect(removalChangeSet.remove).to.contain('node1');
306
- expect(removalChangeSet.remove).to.contain('node2');
299
+ expect(removalChangeSet.remove).to.contain("node1");
300
+ expect(removalChangeSet.remove).to.contain("node2");
307
301
  });
308
- it('Should support deserialization', function () {
309
- var deserializedNode = PropertyFactory.create('NodeProperty');
302
+ it("Should support deserialization", function () {
303
+ var deserializedNode = PropertyFactory.create("NodeProperty");
310
304
  var deserializedChanges1 = deserializedNode.deserialize(changeSetWithTwoMapEntries);
311
- var CS4 = deserializedNode.serialize({ 'dirtyOnly': false });
305
+ var CS4 = deserializedNode.serialize({ dirtyOnly: false });
312
306
  expect(CS4).to.deep.equal(changeSetWithTwoMapEntries);
313
307
  expect(deserializedChanges1).to.deep.equal(changeSetWithTwoMapEntries);
314
308
  var deserializedChanges2 = deserializedNode.deserialize(changeSetWithTwoMapEntries);
@@ -316,100 +310,99 @@ describe('NodeProperty', function () {
316
310
  var deserializedChanges3 = deserializedNode.deserialize({});
317
311
  expect(deserializedChanges3).to.deep.equal(removalChangeSet);
318
312
  });
319
- it('should support deserialization for nested properties', function () {
320
- var P1 = PropertyFactory.create('autodesk.tests:nested.node.property-1.0.0');
321
- var P2 = PropertyFactory.create('autodesk.tests:nested.node.property-1.0.0');
322
- P1._properties.nested.property.propertyNode.insert('testProperty', PropertyFactory.create('String'));
323
- P1._properties.nested.property.testProperty.value = 'testString';
324
- P2.deserialize(P1.serialize({ 'dirtyOnly': false }));
325
- expect(P1.serialize({ 'dirtyOnly': false })).to.deep.equal(P2.serialize({ 'dirtyOnly': false }));
326
- expect(P2._properties.nested.property.testProperty.value).to.equal('testString');
327
- });
328
- it('Should track modifies', function () {
329
- var modifyNode1 = PropertyFactory.create('NodeProperty');
330
- var modifyNode2 = PropertyFactory.create('NodeProperty');
313
+ it("should support deserialization for nested properties", function () {
314
+ var P1 = PropertyFactory.create("autodesk.tests:nested.node.property-1.0.0");
315
+ var P2 = PropertyFactory.create("autodesk.tests:nested.node.property-1.0.0");
316
+ P1._properties.nested.property.propertyNode.insert("testProperty", PropertyFactory.create("String"));
317
+ P1._properties.nested.property.testProperty.value = "testString";
318
+ P2.deserialize(P1.serialize({ dirtyOnly: false }));
319
+ expect(P1.serialize({ dirtyOnly: false })).to.deep.equal(P2.serialize({ dirtyOnly: false }));
320
+ expect(P2._properties.nested.property.testProperty.value).to.equal("testString");
321
+ });
322
+ it("Should track modifies", function () {
323
+ var modifyNode1 = PropertyFactory.create("NodeProperty");
324
+ var modifyNode2 = PropertyFactory.create("NodeProperty");
331
325
  modifyNode1.deserialize(changeSetWithTwoMapEntries);
332
326
  modifyNode2.deserialize(changeSetWithTwoMapEntries);
333
327
  modifyNode1.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
334
328
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
335
- var child1 = modifyNode1.get('node1');
336
- child1._properties.stringProperty.value = 'modify test';
337
- var modifyChangeSet = modifyNode1.serialize({ 'dirtyOnly': true });
329
+ var child1 = modifyNode1.get("node1");
330
+ child1._properties.stringProperty.value = "modify test";
331
+ var modifyChangeSet = modifyNode1.serialize({ dirtyOnly: true });
338
332
  modifyNode2.applyChangeSet(modifyChangeSet);
339
- expect(modifyNode2.serialize({ 'dirtyOnly': false }))
340
- .to.deep.equal(modifyNode1.serialize({ 'dirtyOnly': false }));
333
+ expect(modifyNode2.serialize({ dirtyOnly: false })).to.deep.equal(modifyNode1.serialize({ dirtyOnly: false }));
341
334
  });
342
- it('Should support hierarchical properties', function () {
343
- var node1 = PropertyFactory.create('NodeProperty');
344
- var node2 = PropertyFactory.create('NodeProperty');
345
- var node3 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
335
+ it("Should support hierarchical properties", function () {
336
+ var node1 = PropertyFactory.create("NodeProperty");
337
+ var node2 = PropertyFactory.create("NodeProperty");
338
+ var node3 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
346
339
  // Createa a hierarchy of three nodes
347
- node1.insert('node', node2);
348
- node2.insert('node', node3);
349
- node3._properties.stringProperty.value = 'test';
340
+ node1.insert("node", node2);
341
+ node2.insert("node", node3);
342
+ node3._properties.stringProperty.value = "test";
350
343
  // Check that deserializing and serializing works with a hierarchy
351
- var hierarchicalChangeSet = node1.serialize({ 'dirtyOnly': true });
352
- var deserializedNode = PropertyFactory.create('NodeProperty');
344
+ var hierarchicalChangeSet = node1.serialize({ dirtyOnly: true });
345
+ var deserializedNode = PropertyFactory.create("NodeProperty");
353
346
  deserializedNode.deserialize(hierarchicalChangeSet);
354
347
  var child1 = deserializedNode.get(deserializedNode.getIds()[0]);
355
348
  expect(child1).to.not.equal(undefined);
356
349
  var child2 = child1.get(child1.getIds()[0]);
357
350
  expect(child2).to.not.equal(undefined);
358
- expect(child2._properties.stringProperty.value).to.equal('test');
351
+ expect(child2._properties.stringProperty.value).to.equal("test");
359
352
  // Test that hierarchical modifies work
360
353
  node1.cleanDirty();
361
- node3._properties.stringProperty.value = 'test2';
362
- var hierarchicalModifyChangeSet = node1.serialize({ 'dirtyOnly': true });
354
+ node3._properties.stringProperty.value = "test2";
355
+ var hierarchicalModifyChangeSet = node1.serialize({ dirtyOnly: true });
363
356
  deserializedNode.applyChangeSet(hierarchicalModifyChangeSet);
364
357
  child1 = deserializedNode.get(deserializedNode.getIds()[0]);
365
358
  expect(child1).to.not.equal(undefined);
366
359
  child2 = child1.get(child1.getIds()[0]);
367
360
  expect(child2).to.not.equal(undefined);
368
- expect(child2._properties.stringProperty.value).to.equal('test2');
369
- });
370
- it('should be possible to use anonymous properties', function () {
371
- var rootNode = PropertyFactory.create('NodeProperty');
372
- var rootNode2 = PropertyFactory.create('NodeProperty');
373
- var node1 = PropertyFactory.create('autodesk.tests:AnonymousProperty-1.0.0');
374
- var node2 = PropertyFactory.create('autodesk.tests:AnonymousProperty-1.0.0');
375
- rootNode.insert('node1', node1);
376
- rootNode.insert('node2', node2);
377
- var testChangeSet = rootNode.serialize({ 'dirtyOnly': false });
378
- expect(rootNode.get('node1')).to.be.equal(node1);
379
- expect(rootNode.get('node2')).to.be.equal(node2);
361
+ expect(child2._properties.stringProperty.value).to.equal("test2");
362
+ });
363
+ it("should be possible to use anonymous properties", function () {
364
+ var rootNode = PropertyFactory.create("NodeProperty");
365
+ var rootNode2 = PropertyFactory.create("NodeProperty");
366
+ var node1 = PropertyFactory.create("autodesk.tests:AnonymousProperty-1.0.0");
367
+ var node2 = PropertyFactory.create("autodesk.tests:AnonymousProperty-1.0.0");
368
+ rootNode.insert("node1", node1);
369
+ rootNode.insert("node2", node2);
370
+ var testChangeSet = rootNode.serialize({ dirtyOnly: false });
371
+ expect(rootNode.get("node1")).to.be.equal(node1);
372
+ expect(rootNode.get("node2")).to.be.equal(node2);
380
373
  rootNode.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
381
374
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
382
- node1._properties.stringProperty.value = '1';
383
- node2._properties.stringProperty.value = '2';
375
+ node1._properties.stringProperty.value = "1";
376
+ node2._properties.stringProperty.value = "2";
384
377
  rootNode2.deserialize(testChangeSet);
385
- rootNode2.applyChangeSet(rootNode.serialize({ 'dirtyOnly': true }));
386
- expect(rootNode2.serialize({ 'dirtyOnly': false })).to.be.deep.equal(rootNode.serialize({ 'dirtyOnly': false }));
387
- });
388
- it('inserting the same key twice should throw an exception', function () {
389
- var rootNode = PropertyFactory.create('NodeProperty');
390
- var node1 = PropertyFactory.create('NodeProperty');
391
- var node2 = PropertyFactory.create('NodeProperty');
392
- rootNode.insert('node1', node1);
378
+ rootNode2.applyChangeSet(rootNode.serialize({ dirtyOnly: true }));
379
+ expect(rootNode2.serialize({ dirtyOnly: false })).to.be.deep.equal(rootNode.serialize({ dirtyOnly: false }));
380
+ });
381
+ it("inserting the same key twice should throw an exception", function () {
382
+ var rootNode = PropertyFactory.create("NodeProperty");
383
+ var node1 = PropertyFactory.create("NodeProperty");
384
+ var node2 = PropertyFactory.create("NodeProperty");
385
+ rootNode.insert("node1", node1);
393
386
  expect(function () {
394
- rootNode.insert('node1', node2);
387
+ rootNode.insert("node1", node2);
395
388
  }).to.throw();
396
389
  });
397
- it('Should work to create a MixedNodeTemplate', function () {
398
- var mixedNode = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
399
- mixedNode.insert('dynamicFloat', PropertyFactory.create('Float32'));
400
- mixedNode.insert('dynamicString', PropertyFactory.create('String'));
401
- mixedNode._properties.stringProperty.value = 'string1';
402
- mixedNode._properties.stringProperty2.value = 'string2';
403
- mixedNode._properties.dynamicString.value = 'dynamic2';
390
+ it("Should work to create a MixedNodeTemplate", function () {
391
+ var mixedNode = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
392
+ mixedNode.insert("dynamicFloat", PropertyFactory.create("Float32"));
393
+ mixedNode.insert("dynamicString", PropertyFactory.create("String"));
394
+ mixedNode._properties.stringProperty.value = "string1";
395
+ mixedNode._properties.stringProperty2.value = "string2";
396
+ mixedNode._properties.dynamicString.value = "dynamic2";
404
397
  mixedNode._properties.dynamicFloat.value = 11;
405
- expect(mixedNode.serialize({ 'dirtyOnly': false })).to.deep.equal({
398
+ expect(mixedNode.serialize({ dirtyOnly: false })).to.deep.equal({
406
399
  String: {
407
- stringProperty: 'string1',
408
- stringProperty2: 'string2',
400
+ stringProperty: "string1",
401
+ stringProperty2: "string2",
409
402
  },
410
403
  insert: {
411
404
  String: {
412
- dynamicString: 'dynamic2',
405
+ dynamicString: "dynamic2",
413
406
  },
414
407
  Float32: {
415
408
  dynamicFloat: 11,
@@ -418,88 +411,88 @@ describe('NodeProperty', function () {
418
411
  });
419
412
  mixedNode.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
420
413
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
421
- mixedNode._properties.stringProperty.value = 'modified1';
422
- mixedNode._properties.dynamicString.value = 'modified2';
423
- mixedNode.insert('dynamicString2', PropertyFactory.create('String'));
424
- mixedNode._properties.dynamicString2.value = 'dynamic3';
425
- expect(mixedNode.serialize({ 'dirtyOnly': true })).to.deep.equal({
414
+ mixedNode._properties.stringProperty.value = "modified1";
415
+ mixedNode._properties.dynamicString.value = "modified2";
416
+ mixedNode.insert("dynamicString2", PropertyFactory.create("String"));
417
+ mixedNode._properties.dynamicString2.value = "dynamic3";
418
+ expect(mixedNode.serialize({ dirtyOnly: true })).to.deep.equal({
426
419
  String: {
427
- stringProperty: 'modified1',
420
+ stringProperty: "modified1",
428
421
  },
429
422
  modify: {
430
423
  String: {
431
- dynamicString: 'modified2',
424
+ dynamicString: "modified2",
432
425
  },
433
426
  },
434
427
  insert: {
435
428
  String: {
436
- dynamicString2: 'dynamic3',
429
+ dynamicString2: "dynamic3",
437
430
  },
438
431
  },
439
432
  });
440
433
  // Pretty printing
441
- var expectedPrettyStr = 'undefined (autodesk.tests:MixedNodeTestProperty-1.0.0):\n' +
434
+ var expectedPrettyStr = "undefined (autodesk.tests:MixedNodeTestProperty-1.0.0):\n" +
442
435
  ' stringProperty (String): "modified1"\n' +
443
436
  ' stringProperty2 (String): "string2"\n' +
444
- ' dynamicFloat (Float32): 11\n' +
437
+ " dynamicFloat (Float32): 11\n" +
445
438
  ' dynamicString (String): "modified2"\n' +
446
439
  ' dynamicString2 (String): "dynamic3"\n';
447
- var prettyStr = '';
440
+ var prettyStr = "";
448
441
  mixedNode.prettyPrint(function (str) {
449
- prettyStr += str + '\n';
442
+ prettyStr += str + "\n";
450
443
  });
451
444
  expect(prettyStr).to.equal(expectedPrettyStr);
452
445
  });
453
- it('inserting the same node twice should be a bug', function () {
454
- var rootNode = PropertyFactory.create('NodeProperty');
455
- var node = PropertyFactory.create('NodeProperty');
446
+ it("inserting the same node twice should be a bug", function () {
447
+ var rootNode = PropertyFactory.create("NodeProperty");
448
+ var node = PropertyFactory.create("NodeProperty");
456
449
  // Try to insert the same node object under two keys
457
- rootNode.insert('node', node);
450
+ rootNode.insert("node", node);
458
451
  expect(function () {
459
- rootNode.insert('node2', node);
452
+ rootNode.insert("node2", node);
460
453
  }).to.throw();
461
454
  // After removing it, adding it under a new key should be possible
462
- rootNode.remove('node');
463
- rootNode.insert('node2', node);
455
+ rootNode.remove("node");
456
+ rootNode.insert("node2", node);
464
457
  });
465
- it('should not allow adding two nodes with same id', function () {
458
+ it("should not allow adding two nodes with same id", function () {
466
459
  var NodeTemplate = {
467
- typeid: 'autodesk.tests:NodeTemplate-1.0.0',
468
- inherits: 'NodeProperty',
469
- properties: [{ id: 'a', typeid: 'Float32' }],
460
+ typeid: "autodesk.tests:NodeTemplate-1.0.0",
461
+ inherits: "NodeProperty",
462
+ properties: [{ id: "a", typeid: "Float32" }],
470
463
  };
471
464
  PropertyFactory._reregister(NodeTemplate);
472
- var node = PropertyFactory.create('autodesk.tests:NodeTemplate-1.0.0');
473
- var child = PropertyFactory.create('String');
465
+ var node = PropertyFactory.create("autodesk.tests:NodeTemplate-1.0.0");
466
+ var child = PropertyFactory.create("String");
474
467
  expect(function () {
475
- node.insert('a', child);
476
- }).to.throw(MSG.PROPERTY_ALREADY_EXISTS + 'a');
477
- });
478
- it('Should correctly report whether it is a root', function () {
479
- var root = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
480
- var child = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
481
- var stringProperty = child.resolvePath('stringProperty');
482
- root.insert('childKey', child);
468
+ node.insert("a", child);
469
+ }).to.throw(MSG.PROPERTY_ALREADY_EXISTS + "a");
470
+ });
471
+ it("Should correctly report whether it is a root", function () {
472
+ var root = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
473
+ var child = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
474
+ var stringProperty = child.resolvePath("stringProperty");
475
+ root.insert("childKey", child);
483
476
  assert(root.isRoot());
484
477
  assert(!child.isRoot());
485
- expect(stringProperty.getAbsolutePath()).to.equal('/childKey.stringProperty');
486
- expect(stringProperty.getRelativePath(child)).to.equal('stringProperty');
478
+ expect(stringProperty.getAbsolutePath()).to.equal("/childKey.stringProperty");
479
+ expect(stringProperty.getRelativePath(child)).to.equal("stringProperty");
487
480
  expect(root.resolvePath(stringProperty.getAbsolutePath())).to.equal(stringProperty);
488
481
  expect(child.resolvePath(stringProperty.getRelativePath(child))).to.equal(stringProperty);
489
482
  });
490
- it('should correctly report changes when deserializing keys which contain 0', function () {
491
- var property = PropertyFactory.create('NodeProperty');
492
- property.insert('test', PropertyFactory.create('Int32'));
483
+ it("should correctly report changes when deserializing keys which contain 0", function () {
484
+ var property = PropertyFactory.create("NodeProperty");
485
+ property.insert("test", PropertyFactory.create("Int32"));
493
486
  property._properties.test.value = 5; // Make sure, it is marked as modified
494
487
  property._properties.test.value = 0;
495
- var property2 = PropertyFactory.create('NodeProperty');
496
- property2.insert('test', PropertyFactory.create('Int32'));
488
+ var property2 = PropertyFactory.create("NodeProperty");
489
+ property2.insert("test", PropertyFactory.create("Int32"));
497
490
  property2._properties.test.value = 5;
498
- var actualChanges = property2.deserialize(property.serialize({ 'dirtyOnly': false }));
499
- expect(actualChanges).to.deep.equal({ modify: { 'Int32': { 'test': 0 } } });
491
+ var actualChanges = property2.deserialize(property.serialize({ dirtyOnly: false }));
492
+ expect(actualChanges).to.deep.equal({ modify: { Int32: { test: 0 } } });
500
493
  });
501
494
  });
502
- describe('squashing', function () {
495
+ describe("squashing", function () {
503
496
  //
504
497
  // Helper function which takes a sequence of callbacks that are successively executed
505
498
  // and the changes applied by the callbacks are separately tracked and squashed in a
@@ -510,19 +503,19 @@ describe('NodeProperty', function () {
510
503
  //
511
504
  var testChangeSetSquashing = function (in_options) {
512
505
  resetKeyCounter();
513
- var testProperty = PropertyFactory.create('NodeProperty');
506
+ var testProperty = PropertyFactory.create("NodeProperty");
514
507
  var callbacks = in_options.callbacks;
515
508
  if (in_options.pre) {
516
509
  in_options.pre(testProperty);
517
510
  }
518
- var initialChangeset = new ChangeSet(testProperty.serialize({ 'dirtyOnly': false }));
511
+ var initialChangeset = new ChangeSet(testProperty.serialize({ dirtyOnly: false }));
519
512
  initialChangeset.setIsNormalized(true);
520
513
  var squashedChangeset = new ChangeSet();
521
514
  testProperty.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
522
515
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
523
516
  for (var i = 0; i < callbacks.length; i++) {
524
517
  callbacks[i](testProperty);
525
- var changes = testProperty.serialize({ 'dirtyOnly': true });
518
+ var changes = testProperty.serialize({ dirtyOnly: true });
526
519
  testProperty.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
527
520
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
528
521
  squashedChangeset.applyChangeSet(changes);
@@ -531,105 +524,131 @@ describe('NodeProperty', function () {
531
524
  in_options.post(squashedChangeset.getSerializedChangeSet());
532
525
  }
533
526
  initialChangeset.applyChangeSet(squashedChangeset.getSerializedChangeSet());
534
- expect(initialChangeset.getSerializedChangeSet()).to.deep.equal(testProperty.serialize({ 'dirtyOnly': false }));
527
+ expect(initialChangeset.getSerializedChangeSet()).to.deep.equal(testProperty.serialize({ dirtyOnly: false }));
535
528
  };
536
- it('should work for multiple independent inserts', function () {
537
- testChangeSetSquashing({ callbacks: [insertNodeInRoot, insertNodeInRoot, insertNodeInRoot] });
529
+ it("should work for multiple independent inserts", function () {
530
+ testChangeSetSquashing({
531
+ callbacks: [insertNodeInRoot, insertNodeInRoot, insertNodeInRoot],
532
+ });
538
533
  });
539
- it('should work for multiple hierarchical inserts', function () {
540
- testChangeSetSquashing({ callbacks: [insertNodeAsLeaf, insertNodeAsLeaf, insertNodeAsLeaf] });
534
+ it("should work for multiple hierarchical inserts", function () {
535
+ testChangeSetSquashing({
536
+ callbacks: [insertNodeAsLeaf, insertNodeAsLeaf, insertNodeAsLeaf],
537
+ });
541
538
  });
542
- it('should work for inserts followed by removes', function () {
539
+ it("should work for inserts followed by removes", function () {
543
540
  testChangeSetSquashing({
544
- callbacks: [insertNodeInRoot, insertNodeInRoot, removeFirstNodeInRoot, removeFirstNodeInRoot],
541
+ callbacks: [
542
+ insertNodeInRoot,
543
+ insertNodeInRoot,
544
+ removeFirstNodeInRoot,
545
+ removeFirstNodeInRoot,
546
+ ],
545
547
  post: function (changeset) {
546
548
  expect(changeset).to.be.empty;
547
549
  },
548
550
  });
549
551
  });
550
- it('should work for a tree removal', function () {
552
+ it("should work for a tree removal", function () {
551
553
  testChangeSetSquashing({
552
- callbacks: [insertNodeAsLeaf, insertNodeAsLeaf, insertNodeAsLeaf, removeFirstNodeInRoot],
554
+ callbacks: [
555
+ insertNodeAsLeaf,
556
+ insertNodeAsLeaf,
557
+ insertNodeAsLeaf,
558
+ removeFirstNodeInRoot,
559
+ ],
553
560
  post: function (changeset) {
554
561
  expect(changeset).to.be.empty;
555
562
  },
556
563
  });
557
564
  });
558
- it('should work for modifies in a tree', function () {
565
+ it("should work for modifies in a tree", function () {
559
566
  testChangeSetSquashing({
560
- callbacks: [insertNodeAsLeaf, insertNodeAsLeaf, insertNodeAsLeaf, modifyLeaf, modifyLeaf],
567
+ callbacks: [
568
+ insertNodeAsLeaf,
569
+ insertNodeAsLeaf,
570
+ insertNodeAsLeaf,
571
+ modifyLeaf,
572
+ modifyLeaf,
573
+ ],
561
574
  });
562
575
  });
563
- it('should work for modifies of a primitive type', function () {
576
+ it("should work for modifies of a primitive type", function () {
564
577
  testChangeSetSquashing({
565
578
  callbacks: [
566
579
  function (root) {
567
- var newStringNode = PropertyFactory.create('String');
568
- newStringNode.value = 'initial value';
569
- root.insert('stringProp', newStringNode);
580
+ var newStringNode = PropertyFactory.create("String");
581
+ newStringNode.value = "initial value";
582
+ root.insert("stringProp", newStringNode);
570
583
  },
571
584
  function (root) {
572
- root.get('stringProp').value = 'new value';
585
+ root.get("stringProp").value = "new value";
573
586
  },
574
587
  ],
575
588
  });
576
589
  });
577
- it('an insert, modify and a remove should give an empty changeset', function () {
590
+ it("an insert, modify and a remove should give an empty changeset", function () {
578
591
  testChangeSetSquashing({
579
- callbacks: [insertNodeAsLeaf, insertNodeAsLeaf, modifyLeaf, modifyLeaf, removeFirstNodeInRoot],
592
+ callbacks: [
593
+ insertNodeAsLeaf,
594
+ insertNodeAsLeaf,
595
+ modifyLeaf,
596
+ modifyLeaf,
597
+ removeFirstNodeInRoot,
598
+ ],
580
599
  post: function (changeset) {
581
600
  expect(changeset).to.be.empty;
582
601
  },
583
602
  });
584
603
  });
585
- it('work for modifies after an already existing insert', function () {
604
+ it("work for modifies after an already existing insert", function () {
586
605
  testChangeSetSquashing({
587
606
  pre: insertNodeInRoot,
588
607
  callbacks: [modifyLeaf, modifyLeaf],
589
608
  });
590
609
  });
591
- it('of modify and remove after an already existing insert should work', function () {
610
+ it("of modify and remove after an already existing insert should work", function () {
592
611
  testChangeSetSquashing({
593
612
  pre: insertNodeInRoot,
594
613
  callbacks: [modifyLeaf, removeFirstNodeInRoot],
595
614
  post: function (changeset) {
596
- expect(changeset).to.have.all.keys('remove');
615
+ expect(changeset).to.have.all.keys("remove");
597
616
  },
598
617
  });
599
618
  });
600
- it('of a replace operation should be possible', function () {
619
+ it("of a replace operation should be possible", function () {
601
620
  // Create two nodes
602
- var node1 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
603
- var node2 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
604
- node2._properties.stringProperty.value = 'testString2';
621
+ var node1 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
622
+ var node2 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
623
+ node2._properties.stringProperty.value = "testString2";
605
624
  testChangeSetSquashing({
606
625
  pre: function (root) {
607
- root.insert('node1', node1);
626
+ root.insert("node1", node1);
608
627
  },
609
628
  callbacks: [
610
629
  removeFirstNodeInRoot,
611
630
  function (root) {
612
- root.insert('node1', node2);
631
+ root.insert("node1", node2);
613
632
  },
614
633
  ],
615
634
  post: function (changeset) {
616
- expect(changeset).to.have.all.keys('remove', 'insert');
635
+ expect(changeset).to.have.all.keys("remove", "insert");
617
636
  },
618
637
  });
619
638
  });
620
639
  });
621
- describe('Rebasing', function () {
640
+ describe("Rebasing", function () {
622
641
  var testRebasing = function (in_options) {
623
642
  // Prepare the initial state
624
- var baseProperty1 = PropertyFactory.create('NodeProperty');
643
+ var baseProperty1 = PropertyFactory.create("NodeProperty");
625
644
  if (in_options.prepare) {
626
645
  in_options.prepare(baseProperty1);
627
646
  }
628
647
  // Create two copies of this state
629
- var baseProperty2 = PropertyFactory.create('NodeProperty');
630
- baseProperty2.deserialize(baseProperty1.serialize({ 'dirtyOnly': false }));
631
- var baseProperty3 = PropertyFactory.create('NodeProperty');
632
- baseProperty3.deserialize(baseProperty1.serialize({ 'dirtyOnly': false }));
648
+ var baseProperty2 = PropertyFactory.create("NodeProperty");
649
+ baseProperty2.deserialize(baseProperty1.serialize({ dirtyOnly: false }));
650
+ var baseProperty3 = PropertyFactory.create("NodeProperty");
651
+ baseProperty3.deserialize(baseProperty1.serialize({ dirtyOnly: false }));
633
652
  // Make sure the states are clear
634
653
  baseProperty1.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
635
654
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
@@ -637,7 +656,7 @@ describe('NodeProperty', function () {
637
656
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
638
657
  baseProperty3.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
639
658
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
640
- var initialChangeSet = baseProperty1.serialize({ 'dirtyOnly': false });
659
+ var initialChangeSet = baseProperty1.serialize({ dirtyOnly: false });
641
660
  // Apply the operations to the two properties in parallel
642
661
  if (in_options.op1) {
643
662
  in_options.op1(baseProperty1);
@@ -646,8 +665,8 @@ describe('NodeProperty', function () {
646
665
  in_options.op2(baseProperty2);
647
666
  }
648
667
  // Get the ChangeSets
649
- var changeSet1 = new ChangeSet(baseProperty1.serialize({ 'dirtyOnly': true }));
650
- var changeSet2 = baseProperty2.serialize({ 'dirtyOnly': true });
668
+ var changeSet1 = new ChangeSet(baseProperty1.serialize({ dirtyOnly: true }));
669
+ var changeSet2 = baseProperty2.serialize({ dirtyOnly: true });
651
670
  // Perform the actual rebase
652
671
  var conflicts = [];
653
672
  changeSet1._rebaseChangeSet(changeSet2, conflicts);
@@ -661,59 +680,59 @@ describe('NodeProperty', function () {
661
680
  if (in_options.op2) {
662
681
  in_options.op2(baseProperty3);
663
682
  }
664
- var finalChangeSet = baseProperty3.serialize({ 'dirtyOnly': false });
683
+ var finalChangeSet = baseProperty3.serialize({ dirtyOnly: false });
665
684
  expect(finalChangeSet).to.be.deep.equal(combinedChangeSet.getSerializedChangeSet());
666
685
  }
667
686
  if (in_options.checkResult) {
668
687
  in_options.checkResult(conflicts, changeSet2, combinedChangeSet);
669
688
  }
670
689
  };
671
- it('with a NOP should be possible', function () {
690
+ it("with a NOP should be possible", function () {
672
691
  testRebasing({
673
692
  op2: insertUniqueNodeInRoot(),
674
693
  compareToSequential: true,
675
694
  });
676
695
  });
677
- it('with independent inserts should be possible', function () {
696
+ it("with independent inserts should be possible", function () {
678
697
  testRebasing({
679
698
  op1: insertUniqueNodeInRoot(),
680
699
  op2: insertUniqueNodeInRoot(),
681
700
  compareToSequential: true,
682
701
  });
683
702
  });
684
- it('with independent removes should be possible', function () {
685
- var node1 = PropertyFactory.create('NodeProperty');
686
- var node2 = PropertyFactory.create('NodeProperty');
703
+ it("with independent removes should be possible", function () {
704
+ var node1 = PropertyFactory.create("NodeProperty");
705
+ var node2 = PropertyFactory.create("NodeProperty");
687
706
  testRebasing({
688
707
  prepare: function (root) {
689
- root.insert('node1', node1);
690
- root.insert('node2', node2);
708
+ root.insert("node1", node1);
709
+ root.insert("node2", node2);
691
710
  },
692
711
  op1: function (root) {
693
- root.remove('node1');
712
+ root.remove("node1");
694
713
  },
695
714
  op2: function (root) {
696
- root.remove('node2');
715
+ root.remove("node2");
697
716
  },
698
717
  compareToSequential: true,
699
718
  });
700
719
  });
701
- it('with a modify and a remove should possible', function () {
702
- var node1 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
720
+ it("with a modify and a remove should possible", function () {
721
+ var node1 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
703
722
  testRebasing({
704
723
  prepare: function (root) {
705
- root.insert('node1', node1);
724
+ root.insert("node1", node1);
706
725
  },
707
726
  op1: modifyLeaf,
708
727
  op2: removeFirstNodeInRoot,
709
728
  compareToSequential: true,
710
729
  });
711
730
  });
712
- it('with a remove and a modify should possible', function () {
713
- var node1 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
731
+ it("with a remove and a modify should possible", function () {
732
+ var node1 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
714
733
  testRebasing({
715
734
  prepare: function (root) {
716
- root.insert('node1', node1);
735
+ root.insert("node1", node1);
717
736
  },
718
737
  op1: removeFirstNodeInRoot,
719
738
  op2: modifyLeaf,
@@ -721,22 +740,22 @@ describe('NodeProperty', function () {
721
740
  checkResult: function (conflicts, changeSet) {
722
741
  expect(conflicts).to.have.length(1);
723
742
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.ENTRY_MODIFIED_AFTER_REMOVE);
724
- expect(conflicts[0].path).to.be.equal('node1');
743
+ expect(conflicts[0].path).to.be.equal("node1");
725
744
  expect(ChangeSet.isEmptyChangeSet(changeSet)).to.be.ok;
726
745
  },
727
746
  });
728
747
  });
729
- it('with two compatible removes should be possible', function () {
730
- var node1 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
748
+ it("with two compatible removes should be possible", function () {
749
+ var node1 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
731
750
  testRebasing({
732
751
  prepare: function (root) {
733
- root.insert('node1', node1);
752
+ root.insert("node1", node1);
734
753
  },
735
754
  op1: function (root) {
736
- root.remove('node1');
755
+ root.remove("node1");
737
756
  },
738
757
  op2: function (root) {
739
- root.remove('node1');
758
+ root.remove("node1");
740
759
  },
741
760
  compareToSequential: false,
742
761
  checkResult: function (conflicts, changeSet) {
@@ -744,17 +763,17 @@ describe('NodeProperty', function () {
744
763
  },
745
764
  });
746
765
  });
747
- it('with two indendent recursive modifies should be possible', function () {
748
- var node1 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
766
+ it("with two indendent recursive modifies should be possible", function () {
767
+ var node1 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
749
768
  testRebasing({
750
769
  prepare: function (root) {
751
- root.insert('node1', node1);
770
+ root.insert("node1", node1);
752
771
  },
753
772
  op1: function (root) {
754
- _.values(root._getDynamicChildrenReadOnly())[0]._properties.stringProperty.value = 'a';
773
+ _.values(root._getDynamicChildrenReadOnly())[0]._properties.stringProperty.value = "a";
755
774
  },
756
775
  op2: function (root) {
757
- _.values(root._getDynamicChildrenReadOnly())[0]._properties.stringProperty2.value = 'a';
776
+ _.values(root._getDynamicChildrenReadOnly())[0]._properties.stringProperty2.value = "a";
758
777
  },
759
778
  compareToSequential: true,
760
779
  checkResult: function (conflicts, changeSet) {
@@ -762,125 +781,123 @@ describe('NodeProperty', function () {
762
781
  },
763
782
  });
764
783
  });
765
- it('with two conflicting recursive modifies should be possible and report a conflict', function () {
766
- var node1 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
784
+ it("with two conflicting recursive modifies should be possible and report a conflict", function () {
785
+ var node1 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
767
786
  testRebasing({
768
787
  prepare: function (root) {
769
- root.insert('node1', node1);
788
+ root.insert("node1", node1);
770
789
  },
771
790
  op1: function (root) {
772
- _.values(root._getDynamicChildrenReadOnly())[0]._properties.stringProperty.value = 'b';
791
+ _.values(root._getDynamicChildrenReadOnly())[0]._properties.stringProperty.value = "b";
773
792
  },
774
793
  op2: function (root) {
775
- _.values(root._getDynamicChildrenReadOnly())[0]._properties.stringProperty.value = 'a';
794
+ _.values(root._getDynamicChildrenReadOnly())[0]._properties.stringProperty.value = "a";
776
795
  },
777
796
  compareToSequential: true,
778
797
  checkResult: function (conflicts, changeSet) {
779
798
  expect(conflicts).to.have.length(1);
780
- expect(changeSet.modify['autodesk.tests:MixedNodeTestProperty-1.0.0']
781
- .node1.String.stringProperty).to.equal('a');
799
+ expect(changeSet.modify["autodesk.tests:MixedNodeTestProperty-1.0.0"].node1.String
800
+ .stringProperty).to.equal("a");
782
801
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);
783
- expect(conflicts[0].path).to.be.equal('node1.stringProperty');
802
+ expect(conflicts[0].path).to.be.equal("node1.stringProperty");
784
803
  },
785
804
  });
786
805
  });
787
- it('with modify followed by remove+insert should work', function () {
788
- var node1 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
806
+ it("with modify followed by remove+insert should work", function () {
807
+ var node1 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
789
808
  testRebasing({
790
809
  prepare: function (root) {
791
- root.insert('node1', node1);
810
+ root.insert("node1", node1);
792
811
  },
793
812
  op1: modifyLeaf,
794
813
  op2: function (root) {
795
- var node2 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
796
- root.remove('node1');
797
- root.insert('node1', node2);
814
+ var node2 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
815
+ root.remove("node1");
816
+ root.insert("node1", node2);
798
817
  },
799
818
  compareToSequential: true,
800
819
  checkResult: function (conflicts, changeSet) {
801
820
  expect(conflicts).to.have.length(1);
802
821
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.REMOVE_AFTER_MODIFY);
803
- expect(conflicts[0].path).to.be.equal('node1');
804
- expect(changeSet).to.have.all.keys('remove', 'insert');
822
+ expect(conflicts[0].path).to.be.equal("node1");
823
+ expect(changeSet).to.have.all.keys("remove", "insert");
805
824
  },
806
825
  });
807
826
  });
808
- it('with remove+insert followed by modify should report conflict', function () {
809
- var node1 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
827
+ it("with remove+insert followed by modify should report conflict", function () {
828
+ var node1 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
810
829
  testRebasing({
811
830
  prepare: function (root) {
812
- root.insert('node1', node1);
831
+ root.insert("node1", node1);
813
832
  },
814
833
  op1: function (root) {
815
- var node2 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
816
- root.remove('node1');
817
- root.insert('node1', node2);
834
+ var node2 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
835
+ root.remove("node1");
836
+ root.insert("node1", node2);
818
837
  },
819
838
  op2: modifyLeaf,
820
839
  compareToSequential: false,
821
840
  checkResult: function (conflicts, changeSet) {
822
841
  expect(conflicts).to.have.length(1);
823
842
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT);
824
- expect(conflicts[0].path).to.be.equal('node1');
843
+ expect(conflicts[0].path).to.be.equal("node1");
825
844
  },
826
845
  });
827
846
  });
828
- it('with remove+insert followed by remove+insert should report conflict', function () {
829
- var node = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
847
+ it("with remove+insert followed by remove+insert should report conflict", function () {
848
+ var node = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
830
849
  testRebasing({
831
850
  prepare: function (root) {
832
- root.insert('node', node);
851
+ root.insert("node", node);
833
852
  },
834
853
  op1: function (root) {
835
- root.remove('node');
836
- root.insert('node', PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0'));
854
+ root.remove("node");
855
+ root.insert("node", PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0"));
837
856
  },
838
857
  op2: function (root) {
839
- root.remove('node');
840
- root.insert('node', PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0'));
858
+ root.remove("node");
859
+ root.insert("node", PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0"));
841
860
  },
842
861
  compareToSequential: false,
843
862
  checkResult: function (conflicts, changeSet) {
844
863
  expect(conflicts).to.have.length(1);
845
864
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);
846
- expect(conflicts[0].path).to.be.equal('node');
865
+ expect(conflicts[0].path).to.be.equal("node");
847
866
  },
848
867
  });
849
868
  });
850
- it('with conflicting inserts should report conflict', function () {
851
- var node1 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
852
- var node2 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
869
+ it("with conflicting inserts should report conflict", function () {
870
+ var node1 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
871
+ var node2 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
853
872
  testRebasing({
854
- prepare: function (root) {
855
- },
873
+ prepare: function (root) { },
856
874
  op1: function (root) {
857
- root.insert('node1', node1);
875
+ root.insert("node1", node1);
858
876
  },
859
877
  op2: function (root) {
860
- root.insert('node1', node2);
878
+ root.insert("node1", node2);
861
879
  },
862
880
  compareToSequential: false,
863
881
  checkResult: function (conflicts, changeSet) {
864
882
  expect(ChangeSet.isEmptyChangeSet(changeSet)).to.be.ok;
865
883
  expect(conflicts).to.have.length(1);
866
884
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.INSERTED_ENTRY_WITH_SAME_KEY);
867
- expect(conflicts[0].path).to.be.equal('node1');
885
+ expect(conflicts[0].path).to.be.equal("node1");
868
886
  },
869
887
  });
870
888
  });
871
- it('with conflicting inserts of primitive types', function () {
889
+ it("with conflicting inserts of primitive types", function () {
872
890
  testRebasing({
873
- prepare: function (root) {
874
- },
891
+ prepare: function (root) { },
875
892
  op1: function (root) {
876
- var string1 = PropertyFactory.create('String');
877
- string1.value = 'test1';
878
- root.insert('entry', string1);
893
+ var string1 = PropertyFactory.create("String");
894
+ string1.value = "test1";
895
+ root.insert("entry", string1);
879
896
  },
880
897
  op2: function (root) {
881
- var string2 = PropertyFactory.create('String');
882
- string2.value = 'test2';
883
- root.insert('entry', string2);
898
+ var string2 = PropertyFactory.create("String");
899
+ string2.value = "test2";
900
+ root.insert("entry", string2);
884
901
  },
885
902
  compareToSequential: false,
886
903
  checkResult: function (conflicts, changeSet) {
@@ -888,33 +905,32 @@ describe('NodeProperty', function () {
888
905
  modify: {
889
906
  String: {
890
907
  entry: {
891
- oldValue: 'test1',
892
- value: 'test2',
908
+ oldValue: "test1",
909
+ value: "test2",
893
910
  },
894
911
  },
895
912
  },
896
913
  });
897
914
  expect(conflicts).to.have.length(1);
898
915
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);
899
- expect(conflicts[0].path).to.be.equal('entry');
900
- expect(conflicts[0].conflictingChange).to.be.equal('test2');
916
+ expect(conflicts[0].path).to.be.equal("entry");
917
+ expect(conflicts[0].conflictingChange).to.be.equal("test2");
901
918
  },
902
919
  });
903
920
  });
904
921
  // TODO: 'with conflicting inserts of primitive types' is identical to the below test. Why?
905
- it('with conflicting recursive modifies of primitive types should be possible and report a conflict', function () {
922
+ it("with conflicting recursive modifies of primitive types should be possible and report a conflict", function () {
906
923
  testRebasing({
907
- prepare: function (root) {
908
- },
924
+ prepare: function (root) { },
909
925
  op1: function (root) {
910
- var string1 = PropertyFactory.create('String');
911
- string1.value = 'test1';
912
- root.insert('entry', string1);
926
+ var string1 = PropertyFactory.create("String");
927
+ string1.value = "test1";
928
+ root.insert("entry", string1);
913
929
  },
914
930
  op2: function (root) {
915
- var string2 = PropertyFactory.create('String');
916
- string2.value = 'test2';
917
- root.insert('entry', string2);
931
+ var string2 = PropertyFactory.create("String");
932
+ string2.value = "test2";
933
+ root.insert("entry", string2);
918
934
  },
919
935
  compareToSequential: false,
920
936
  checkResult: function (conflicts, changeSet) {
@@ -922,38 +938,37 @@ describe('NodeProperty', function () {
922
938
  modify: {
923
939
  String: {
924
940
  entry: {
925
- oldValue: 'test1',
926
- value: 'test2',
941
+ oldValue: "test1",
942
+ value: "test2",
927
943
  },
928
944
  },
929
945
  },
930
946
  });
931
947
  expect(conflicts).to.have.length(1);
932
948
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);
933
- expect(conflicts[0].path).to.be.equal('entry');
934
- expect(conflicts[0].conflictingChange).to.be.equal('test2');
949
+ expect(conflicts[0].path).to.be.equal("entry");
950
+ expect(conflicts[0].conflictingChange).to.be.equal("test2");
935
951
  },
936
952
  });
937
953
  });
938
- it('with conflicting recursive modifies of enums should be possible and report a conflict', function () {
954
+ it("with conflicting recursive modifies of enums should be possible and report a conflict", function () {
939
955
  testRebasing({
940
- prepare: function (root) {
941
- },
956
+ prepare: function (root) { },
942
957
  op1: function (root) {
943
- var enum1 = PropertyFactory.create('autodesk.core:UnitsEnum-1.0.0');
958
+ var enum1 = PropertyFactory.create("autodesk.core:UnitsEnum-1.0.0");
944
959
  enum1.value = 1;
945
- root.insert('entry', enum1);
960
+ root.insert("entry", enum1);
946
961
  },
947
962
  op2: function (root) {
948
- var enum2 = PropertyFactory.create('autodesk.core:UnitsEnum-1.0.0');
963
+ var enum2 = PropertyFactory.create("autodesk.core:UnitsEnum-1.0.0");
949
964
  enum2.value = 2;
950
- root.insert('entry', enum2);
965
+ root.insert("entry", enum2);
951
966
  },
952
967
  compareToSequential: false,
953
968
  checkResult: function (conflicts, changeSet) {
954
969
  expect(changeSet).to.deep.equal({
955
970
  modify: {
956
- 'enum<autodesk.core:UnitsEnum-1.0.0>': {
971
+ "enum<autodesk.core:UnitsEnum-1.0.0>": {
957
972
  entry: {
958
973
  oldValue: 1,
959
974
  value: 2,
@@ -963,67 +978,67 @@ describe('NodeProperty', function () {
963
978
  });
964
979
  expect(conflicts).to.have.length(1);
965
980
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);
966
- expect(conflicts[0].path).to.be.equal('entry');
981
+ expect(conflicts[0].path).to.be.equal("entry");
967
982
  expect(conflicts[0].conflictingChange).to.be.equal(2);
968
983
  },
969
984
  });
970
985
  });
971
- it('with conflicting inserts in a deep leaf should report a correct conflict', function () {
986
+ it("with conflicting inserts in a deep leaf should report a correct conflict", function () {
972
987
  testRebasing({
973
988
  prepare: function (root) {
974
- var node = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
975
- root.insert('node', node);
989
+ var node = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
990
+ root.insert("node", node);
976
991
  },
977
992
  op1: function (root) {
978
- var node1 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
979
- root.resolvePath('node').insert('node2', node1);
993
+ var node1 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
994
+ root.resolvePath("node").insert("node2", node1);
980
995
  },
981
996
  op2: function (root) {
982
- var node2 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
983
- root.resolvePath('node').insert('node2', node2);
997
+ var node2 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
998
+ root.resolvePath("node").insert("node2", node2);
984
999
  },
985
1000
  compareToSequential: false,
986
1001
  checkResult: function (conflicts, changeSet) {
987
1002
  expect(ChangeSet.isEmptyChangeSet(changeSet)).to.be.ok;
988
1003
  expect(conflicts).to.have.length(1);
989
1004
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.INSERTED_ENTRY_WITH_SAME_KEY);
990
- expect(conflicts[0].path).to.be.equal('node.node2');
1005
+ expect(conflicts[0].path).to.be.equal("node.node2");
991
1006
  },
992
1007
  });
993
1008
  });
994
1009
  });
995
- describe('Compatibility with ChangeSets from spec', function () {
1010
+ describe("Compatibility with ChangeSets from spec", function () {
996
1011
  // These are the ChangeSets from the discussion minutes document
997
1012
  // after some cleanup, mainly missing parameters were added in inserts and
998
1013
  // syntax corrections. Additionally, the Vector3 was renamed to autodesk.test:vector3-1.0.0 to avoid
999
1014
  // conflicts with the inbuilt type
1000
1015
  var insertChangeSet1 = {
1001
1016
  insert: {
1002
- 'autodesk.test:point2d-1.0.0': {
1003
- 'myPoint': {
1004
- 'Float32': {
1005
- 'position.x': 122,
1006
- 'position.y': 122,
1007
- 'temperature': 10,
1017
+ "autodesk.test:point2d-1.0.0": {
1018
+ myPoint: {
1019
+ "Float32": {
1020
+ "position.x": 122,
1021
+ "position.y": 122,
1022
+ "temperature": 10,
1008
1023
  },
1009
- 'autodesk.test:vector3-1.0.0': {
1010
- 'normal': {
1024
+ "autodesk.test:vector3-1.0.0": {
1025
+ normal: {
1011
1026
  Float32: {
1012
- 'x': 1,
1013
- 'y': 1,
1014
- 'z': 1,
1027
+ x: 1,
1028
+ y: 1,
1029
+ z: 1,
1015
1030
  },
1016
1031
  },
1017
1032
  },
1018
- 'map<autodesk.test:vector3-1.0.0>': {
1019
- 'neighbours': {
1033
+ "map<autodesk.test:vector3-1.0.0>": {
1034
+ neighbours: {
1020
1035
  insert: {
1021
- 'autodesk.test:vector3-1.0.0': {
1022
- 'Point1': {
1036
+ "autodesk.test:vector3-1.0.0": {
1037
+ Point1: {
1023
1038
  Float32: {
1024
- 'x': 1,
1025
- 'y': 1,
1026
- 'z': 1,
1039
+ x: 1,
1040
+ y: 1,
1041
+ z: 1,
1027
1042
  },
1028
1043
  },
1029
1044
  },
@@ -1031,38 +1046,38 @@ describe('NodeProperty', function () {
1031
1046
  },
1032
1047
  },
1033
1048
  },
1034
- 'd23kjda': {
1035
- Float32: {
1036
- 'position.x': 122,
1037
- 'position.y': 122,
1038
- 'temperature': 11,
1049
+ d23kjda: {
1050
+ "Float32": {
1051
+ "position.x": 122,
1052
+ "position.y": 122,
1053
+ "temperature": 11,
1039
1054
  },
1040
- 'autodesk.test:vector3-1.0.0': {
1041
- 'normal': {
1055
+ "autodesk.test:vector3-1.0.0": {
1056
+ normal: {
1042
1057
  Float32: {
1043
- 'x': 1,
1044
- 'y': 1,
1045
- 'z': 1,
1058
+ x: 1,
1059
+ y: 1,
1060
+ z: 1,
1046
1061
  },
1047
1062
  },
1048
1063
  },
1049
- 'map<autodesk.test:vector3-1.0.0>': {
1050
- 'neighbours': {},
1064
+ "map<autodesk.test:vector3-1.0.0>": {
1065
+ neighbours: {},
1051
1066
  },
1052
1067
  },
1053
1068
  },
1054
- Float32: {
1055
- 'compression': 0,
1069
+ "Float32": {
1070
+ compression: 0,
1056
1071
  },
1057
- 'map<>': {
1072
+ "map<>": {
1058
1073
  birds: {
1059
1074
  insert: {
1060
- 'autodesk.test:vector3-1.0.0': {
1061
- 'Point1': {
1075
+ "autodesk.test:vector3-1.0.0": {
1076
+ Point1: {
1062
1077
  Float32: {
1063
- 'x': 1,
1064
- 'y': 1,
1065
- 'z': 1,
1078
+ x: 1,
1079
+ y: 1,
1080
+ z: 1,
1066
1081
  },
1067
1082
  },
1068
1083
  },
@@ -1075,16 +1090,16 @@ describe('NodeProperty', function () {
1075
1090
  };
1076
1091
  var modifyChangeSet1 = {
1077
1092
  modify: {
1078
- 'autodesk.test:point2d-1.0.0': {
1079
- 'myPoint': {
1080
- 'Float32': {
1081
- 'position.x': 11,
1082
- 'temperature': 31,
1093
+ "autodesk.test:point2d-1.0.0": {
1094
+ myPoint: {
1095
+ "Float32": {
1096
+ "position.x": 11,
1097
+ "temperature": 31,
1083
1098
  },
1084
- 'autodesk.test:vector3-1.0.0': {
1085
- 'normal': {
1086
- 'Float32': {
1087
- 'x': 0.5,
1099
+ "autodesk.test:vector3-1.0.0": {
1100
+ normal: {
1101
+ Float32: {
1102
+ x: 0.5,
1088
1103
  },
1089
1104
  },
1090
1105
  },
@@ -1094,17 +1109,17 @@ describe('NodeProperty', function () {
1094
1109
  };
1095
1110
  var modifyChangeSet2 = {
1096
1111
  modify: {
1097
- 'autodesk.test:point2d-1.0.0': {
1098
- 'myPoint': {
1099
- 'map<autodesk.test:vector3-1.0.0>': {
1100
- 'neighbours': {
1112
+ "autodesk.test:point2d-1.0.0": {
1113
+ myPoint: {
1114
+ "map<autodesk.test:vector3-1.0.0>": {
1115
+ neighbours: {
1101
1116
  insert: {
1102
- 'autodesk.test:vector3-1.0.0': {
1103
- 'Point2': {
1117
+ "autodesk.test:vector3-1.0.0": {
1118
+ Point2: {
1104
1119
  Float32: {
1105
- 'x': 1,
1106
- 'y': 1,
1107
- 'z': 1,
1120
+ x: 1,
1121
+ y: 1,
1122
+ z: 1,
1108
1123
  },
1109
1124
  },
1110
1125
  },
@@ -1117,15 +1132,15 @@ describe('NodeProperty', function () {
1117
1132
  };
1118
1133
  var modifyChangeSet3 = {
1119
1134
  modify: {
1120
- 'autodesk.test:point2d-1.0.0': {
1121
- 'myPoint': {
1122
- 'map<autodesk.test:vector3-1.0.0>': {
1123
- 'neighbours': {
1135
+ "autodesk.test:point2d-1.0.0": {
1136
+ myPoint: {
1137
+ "map<autodesk.test:vector3-1.0.0>": {
1138
+ neighbours: {
1124
1139
  modify: {
1125
- 'autodesk.test:vector3-1.0.0': {
1126
- 'Point2': {
1140
+ "autodesk.test:vector3-1.0.0": {
1141
+ Point2: {
1127
1142
  Float32: {
1128
- 'x': 2,
1143
+ x: 2,
1129
1144
  },
1130
1145
  },
1131
1146
  },
@@ -1138,11 +1153,11 @@ describe('NodeProperty', function () {
1138
1153
  };
1139
1154
  var removePreparationChangeSet1 = {
1140
1155
  insert: {
1141
- 'autodesk.test:SceneObject-1.0.0': {
1142
- 'dasdm23': {
1143
- 'String': {
1144
- 'revitId': '#23213',
1145
- 'name': 'Door',
1156
+ "autodesk.test:SceneObject-1.0.0": {
1157
+ dasdm23: {
1158
+ String: {
1159
+ revitId: "#23213",
1160
+ name: "Door",
1146
1161
  },
1147
1162
  },
1148
1163
  },
@@ -1150,14 +1165,14 @@ describe('NodeProperty', function () {
1150
1165
  };
1151
1166
  var removePreparationChangeSet2 = {
1152
1167
  modify: {
1153
- 'autodesk.test:SceneObject-1.0.0': {
1154
- 'dasdm23': {
1168
+ "autodesk.test:SceneObject-1.0.0": {
1169
+ dasdm23: {
1155
1170
  insert: {
1156
- 'autodesk.test:SceneObject-1.0.0': {
1157
- 'as2398d': {
1158
- 'String': {
1159
- 'revitId': '#2231',
1160
- 'name': 'Room',
1171
+ "autodesk.test:SceneObject-1.0.0": {
1172
+ as2398d: {
1173
+ String: {
1174
+ revitId: "#2231",
1175
+ name: "Room",
1161
1176
  },
1162
1177
  },
1163
1178
  },
@@ -1167,86 +1182,82 @@ describe('NodeProperty', function () {
1167
1182
  },
1168
1183
  };
1169
1184
  var removeChangeSet1 = {
1170
- remove: [
1171
- 'dasdm23',
1172
- ],
1185
+ remove: ["dasdm23"],
1173
1186
  };
1174
1187
  var removeChangeSet2 = {
1175
1188
  modify: {
1176
- 'autodesk.test:SceneObject-1.0.0': {
1177
- 'dasdm23': {
1178
- remove: [
1179
- 'as2398d',
1180
- ],
1189
+ "autodesk.test:SceneObject-1.0.0": {
1190
+ dasdm23: {
1191
+ remove: ["as2398d"],
1181
1192
  },
1182
1193
  },
1183
1194
  },
1184
1195
  };
1185
- it('should be possible to insert properties with the example from the spec', function () {
1186
- var rootProperty = PropertyFactory.create('NodeProperty');
1196
+ it("should be possible to insert properties with the example from the spec", function () {
1197
+ var rootProperty = PropertyFactory.create("NodeProperty");
1187
1198
  rootProperty.applyChangeSet(insertChangeSet1);
1188
1199
  // Make sure all properties are as expected
1189
1200
  expect(rootProperty.getDynamicIds().length).to.equal(6);
1190
- expect(rootProperty._getDynamicChildrenReadOnly()).to.have.all.keys('birds', 'horses', 'forest', 'compression', 'myPoint', 'd23kjda');
1201
+ expect(rootProperty._getDynamicChildrenReadOnly()).to.have.all.keys("birds", "horses", "forest", "compression", "myPoint", "d23kjda");
1191
1202
  expect(rootProperty._properties.compression.value).to.equal(0);
1192
1203
  assert(rootProperty._properties.birds instanceof MapProperty);
1193
1204
  assert(rootProperty._properties.forest instanceof MapProperty);
1194
1205
  assert(rootProperty._properties.horses instanceof MapProperty);
1195
- expect(rootProperty.resolvePath('myPoint.position.x').value).to.equal(122);
1196
- expect(rootProperty.resolvePath('myPoint.position.y').value).to.equal(122);
1197
- expect(rootProperty.resolvePath('myPoint.temperature').value).to.equal(10);
1198
- expect(rootProperty.resolvePath('myPoint.normal.x').value).to.equal(1);
1199
- expect(rootProperty.resolvePath('myPoint.normal.y').value).to.equal(1);
1200
- expect(rootProperty.resolvePath('myPoint.normal.z').value).to.equal(1);
1201
- var neighbours = rootProperty.resolvePath('myPoint.neighbours');
1202
- assert(neighbours.has('Point1'));
1203
- expect(neighbours.get('Point1')._properties.x.value).to.equal(1);
1204
- expect(neighbours.get('Point1')._properties.y.value).to.equal(1);
1205
- expect(neighbours.get('Point1')._properties.z.value).to.equal(1);
1206
- expect(rootProperty.resolvePath('d23kjda.position.x').value).to.equal(122);
1207
- expect(rootProperty.resolvePath('d23kjda.position.y').value).to.equal(122);
1208
- expect(rootProperty.resolvePath('d23kjda.temperature').value).to.equal(11);
1209
- expect(rootProperty.resolvePath('d23kjda.normal.x').value).to.equal(1);
1210
- expect(rootProperty.resolvePath('d23kjda.normal.y').value).to.equal(1);
1211
- expect(rootProperty.resolvePath('d23kjda.normal.z').value).to.equal(1);
1206
+ expect(rootProperty.resolvePath("myPoint.position.x").value).to.equal(122);
1207
+ expect(rootProperty.resolvePath("myPoint.position.y").value).to.equal(122);
1208
+ expect(rootProperty.resolvePath("myPoint.temperature").value).to.equal(10);
1209
+ expect(rootProperty.resolvePath("myPoint.normal.x").value).to.equal(1);
1210
+ expect(rootProperty.resolvePath("myPoint.normal.y").value).to.equal(1);
1211
+ expect(rootProperty.resolvePath("myPoint.normal.z").value).to.equal(1);
1212
+ var neighbours = rootProperty.resolvePath("myPoint.neighbours");
1213
+ assert(neighbours.has("Point1"));
1214
+ expect(neighbours.get("Point1")._properties.x.value).to.equal(1);
1215
+ expect(neighbours.get("Point1")._properties.y.value).to.equal(1);
1216
+ expect(neighbours.get("Point1")._properties.z.value).to.equal(1);
1217
+ expect(rootProperty.resolvePath("d23kjda.position.x").value).to.equal(122);
1218
+ expect(rootProperty.resolvePath("d23kjda.position.y").value).to.equal(122);
1219
+ expect(rootProperty.resolvePath("d23kjda.temperature").value).to.equal(11);
1220
+ expect(rootProperty.resolvePath("d23kjda.normal.x").value).to.equal(1);
1221
+ expect(rootProperty.resolvePath("d23kjda.normal.y").value).to.equal(1);
1222
+ expect(rootProperty.resolvePath("d23kjda.normal.z").value).to.equal(1);
1212
1223
  // Make sure serialization gives the same result as the initial ChangeSet
1213
- expect(rootProperty.serialize({ 'dirtyOnly': false })).to.deep.equal(insertChangeSet1);
1214
- expect(rootProperty.serialize({ 'dirtyOnly': true })).to.deep.equal(insertChangeSet1);
1224
+ expect(rootProperty.serialize({ dirtyOnly: false })).to.deep.equal(insertChangeSet1);
1225
+ expect(rootProperty.serialize({ dirtyOnly: true })).to.deep.equal(insertChangeSet1);
1215
1226
  });
1216
- it('should be possible to use the first modify ChangeSet from the spec', function () {
1227
+ it("should be possible to use the first modify ChangeSet from the spec", function () {
1217
1228
  // Prepare the initial state
1218
- var rootProperty = PropertyFactory.create('NodeProperty');
1229
+ var rootProperty = PropertyFactory.create("NodeProperty");
1219
1230
  rootProperty.applyChangeSet(insertChangeSet1);
1220
1231
  // Clean dirtiness
1221
1232
  rootProperty.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
1222
1233
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
1223
1234
  // Apply the modify changeSet
1224
1235
  rootProperty.applyChangeSet(modifyChangeSet1);
1225
- expect(rootProperty.resolvePath('myPoint.position.x').value).to.equal(11);
1226
- expect(rootProperty.resolvePath('myPoint.normal.x').value).to.equal(0.5);
1227
- expect(rootProperty.resolvePath('myPoint.temperature').value).to.equal(31);
1236
+ expect(rootProperty.resolvePath("myPoint.position.x").value).to.equal(11);
1237
+ expect(rootProperty.resolvePath("myPoint.normal.x").value).to.equal(0.5);
1238
+ expect(rootProperty.resolvePath("myPoint.temperature").value).to.equal(31);
1228
1239
  // Make sure the serialization gives the expected result
1229
- expect(rootProperty.serialize({ 'dirtyOnly': true })).to.deep.equal(modifyChangeSet1);
1240
+ expect(rootProperty.serialize({ dirtyOnly: true })).to.deep.equal(modifyChangeSet1);
1230
1241
  });
1231
- it('should be possible to use the second modify ChangeSet from the spec', function () {
1242
+ it("should be possible to use the second modify ChangeSet from the spec", function () {
1232
1243
  // Prepare the initial state
1233
- var rootProperty = PropertyFactory.create('NodeProperty');
1244
+ var rootProperty = PropertyFactory.create("NodeProperty");
1234
1245
  rootProperty.applyChangeSet(insertChangeSet1);
1235
1246
  // Clean dirtiness
1236
1247
  rootProperty.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
1237
1248
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
1238
1249
  // Apply the modify changeSet
1239
1250
  rootProperty.applyChangeSet(modifyChangeSet2);
1240
- var point2 = rootProperty.resolvePath('myPoint.neighbours').get('Point2');
1251
+ var point2 = rootProperty.resolvePath("myPoint.neighbours").get("Point2");
1241
1252
  expect(point2._properties.x.value).to.equal(1);
1242
1253
  expect(point2._properties.y.value).to.equal(1);
1243
1254
  expect(point2._properties.z.value).to.equal(1);
1244
1255
  // Make sure the serialization gives the expected result
1245
- expect(rootProperty.serialize({ 'dirtyOnly': true })).to.deep.equal(modifyChangeSet2);
1256
+ expect(rootProperty.serialize({ dirtyOnly: true })).to.deep.equal(modifyChangeSet2);
1246
1257
  });
1247
- it('should be possible to use the third modify ChangeSet from the spec', function () {
1258
+ it("should be possible to use the third modify ChangeSet from the spec", function () {
1248
1259
  // Prepare the initial state
1249
- var rootProperty = PropertyFactory.create('NodeProperty');
1260
+ var rootProperty = PropertyFactory.create("NodeProperty");
1250
1261
  rootProperty.applyChangeSet(insertChangeSet1);
1251
1262
  rootProperty.applyChangeSet(modifyChangeSet2);
1252
1263
  // Clean dirtiness
@@ -1254,14 +1265,14 @@ describe('NodeProperty', function () {
1254
1265
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
1255
1266
  // Apply the modify changeSet
1256
1267
  rootProperty.applyChangeSet(modifyChangeSet3);
1257
- var point2 = rootProperty.resolvePath('myPoint.neighbours').get('Point2');
1268
+ var point2 = rootProperty.resolvePath("myPoint.neighbours").get("Point2");
1258
1269
  expect(point2._properties.x.value).to.equal(2);
1259
1270
  // Make sure the serialization gives the expected result
1260
- expect(rootProperty.serialize({ 'dirtyOnly': true })).to.deep.equal(modifyChangeSet3);
1271
+ expect(rootProperty.serialize({ dirtyOnly: true })).to.deep.equal(modifyChangeSet3);
1261
1272
  });
1262
- it('should be possible to use the first remove ChangeSet from the spec', function () {
1273
+ it("should be possible to use the first remove ChangeSet from the spec", function () {
1263
1274
  // Prepare the initial state
1264
- var rootProperty = PropertyFactory.create('NodeProperty');
1275
+ var rootProperty = PropertyFactory.create("NodeProperty");
1265
1276
  rootProperty.applyChangeSet(removePreparationChangeSet1);
1266
1277
  rootProperty.applyChangeSet(removePreparationChangeSet2);
1267
1278
  // Clean dirtiness
@@ -1272,70 +1283,70 @@ describe('NodeProperty', function () {
1272
1283
  rootProperty.applyChangeSet(removeChangeSet1);
1273
1284
  expect(rootProperty.getDynamicIds().length).to.be.equal(0);
1274
1285
  // Make sure the serialization gives the expected result
1275
- expect(rootProperty.serialize({ 'dirtyOnly': true })).to.deep.equal(removeChangeSet1);
1286
+ expect(rootProperty.serialize({ dirtyOnly: true })).to.deep.equal(removeChangeSet1);
1276
1287
  });
1277
- it('should be possible to use the first remove ChangeSet from the spec', function () {
1288
+ it("should be possible to use the first remove ChangeSet from the spec", function () {
1278
1289
  // Prepare the initial state
1279
- var rootProperty = PropertyFactory.create('NodeProperty');
1290
+ var rootProperty = PropertyFactory.create("NodeProperty");
1280
1291
  rootProperty.applyChangeSet(removePreparationChangeSet1);
1281
1292
  rootProperty.applyChangeSet(removePreparationChangeSet2);
1282
1293
  // Clean dirtiness
1283
1294
  rootProperty.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
1284
1295
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
1285
1296
  // Apply the remove changeSet
1286
- expect(rootProperty.resolvePath('dasdm23').getDynamicIds().length).to.be.equal(1);
1297
+ expect(rootProperty.resolvePath("dasdm23").getDynamicIds().length).to.be.equal(1);
1287
1298
  rootProperty.applyChangeSet(removeChangeSet2);
1288
1299
  expect(rootProperty.getDynamicIds().length).to.be.equal(1);
1289
- expect(rootProperty.resolvePath('dasdm23').getDynamicIds().length).to.be.equal(0);
1300
+ expect(rootProperty.resolvePath("dasdm23").getDynamicIds().length).to.be.equal(0);
1290
1301
  // Make sure the serialization gives the expected result
1291
- expect(rootProperty.serialize({ 'dirtyOnly': true })).to.deep.equal(removeChangeSet2);
1302
+ expect(rootProperty.serialize({ dirtyOnly: true })).to.deep.equal(removeChangeSet2);
1292
1303
  });
1293
1304
  });
1294
- describe('Make sure struct changes and path updates are signaled correctly', function () {
1295
- it('Should be possible to access dynamic nodes via propertis and paths', function () {
1296
- var root = PropertyFactory.create('NodeProperty');
1297
- var newRoot = PropertyFactory.create('NodeProperty');
1305
+ describe("Make sure struct changes and path updates are signaled correctly", function () {
1306
+ it("Should be possible to access dynamic nodes via propertis and paths", function () {
1307
+ var root = PropertyFactory.create("NodeProperty");
1308
+ var newRoot = PropertyFactory.create("NodeProperty");
1298
1309
  // Create a hierarchy of nodes
1299
- root.insert('child1', PropertyFactory.create('NodeProperty'));
1300
- root.insert('child2', PropertyFactory.create('NodeProperty'));
1310
+ root.insert("child1", PropertyFactory.create("NodeProperty"));
1311
+ root.insert("child2", PropertyFactory.create("NodeProperty"));
1301
1312
  expect(root._properties.child1.position).to.be.undefined;
1302
- expect(root.resolvePath('child1.position')).to.be.undefined;
1313
+ expect(root.resolvePath("child1.position")).to.be.undefined;
1303
1314
  // Crate a dynamic object via a NodeProperty
1304
- var positionProperty = PropertyFactory.create('NodeProperty');
1305
- root._properties.child1.propertyNode.insert('position', positionProperty);
1306
- root._properties.child1.position.propertyNode.insert('x', PropertyFactory.create('Float32'));
1307
- root._properties.child1.position.propertyNode.insert('y', PropertyFactory.create('Float32'));
1308
- root._properties.child1.position.propertyNode.insert('z', PropertyFactory.create('Float32'));
1315
+ var positionProperty = PropertyFactory.create("NodeProperty");
1316
+ root._properties.child1.propertyNode.insert("position", positionProperty);
1317
+ root._properties.child1.position.propertyNode.insert("x", PropertyFactory.create("Float32"));
1318
+ root._properties.child1.position.propertyNode.insert("y", PropertyFactory.create("Float32"));
1319
+ root._properties.child1.position.propertyNode.insert("z", PropertyFactory.create("Float32"));
1309
1320
  // Make sure paths resolve correctly
1310
1321
  expect(root._properties.child1.position).not.to.be.undefined;
1311
1322
  expect(root._properties.child1.position.propertyNode).to.be.an.instanceof(NodeProperty);
1312
- expect(root.resolvePath('child1.position')).to.be.instanceof(NodeProperty);
1323
+ expect(root.resolvePath("child1.position")).to.be.instanceof(NodeProperty);
1313
1324
  // assign values via the properties object (for NodeProperty)
1314
1325
  root._properties.child1.position.x.value = 1;
1315
1326
  root._properties.child1.position.y.value = 2;
1316
1327
  root._properties.child1.position.z.value = 3;
1317
1328
  // assign values via resolve path
1318
- root.resolvePath('child1.position.x').value = 3;
1319
- root.resolvePath('child1.position.y').value = 2;
1320
- root.resolvePath('child1.position.z').value = 1;
1329
+ root.resolvePath("child1.position.x").value = 3;
1330
+ root.resolvePath("child1.position.y").value = 2;
1331
+ root.resolvePath("child1.position.z").value = 1;
1321
1332
  // Check values
1322
1333
  expect(root._properties.child1.position.x.value).to.equal(3);
1323
1334
  expect(root._properties.child1.position.y.value).to.equal(2);
1324
1335
  expect(root._properties.child1.position.z.value).to.equal(1);
1325
1336
  // Crate a dynamic object via a template
1326
- var vec3Property = PropertyFactory.create('autodesk.test:vector3-1.0.0');
1327
- root._properties.child1.propertyNode.insert('vector', vec3Property);
1337
+ var vec3Property = PropertyFactory.create("autodesk.test:vector3-1.0.0");
1338
+ root._properties.child1.propertyNode.insert("vector", vec3Property);
1328
1339
  // Make sure paths resolve correctly
1329
1340
  expect(root._properties.child1.vector).not.to.be.undefined;
1330
1341
  expect(root._properties.child1.vector.propertyNode).to.be.an.instanceof(BaseProperty);
1331
- expect(root.resolvePath('child1.vector')).to.be.instanceof(BaseProperty);
1342
+ expect(root.resolvePath("child1.vector")).to.be.instanceof(BaseProperty);
1332
1343
  root._properties.child1.vector.x.value = 1;
1333
1344
  root._properties.child1.vector.y.value = 2;
1334
1345
  root._properties.child1.vector.z.value = 3;
1335
1346
  // assign values via resolve path
1336
- root.resolvePath('child1.vector.x').value = 3;
1337
- root.resolvePath('child1.vector.y').value = 2;
1338
- root.resolvePath('child1.vector.z').value = 1;
1347
+ root.resolvePath("child1.vector.x").value = 3;
1348
+ root.resolvePath("child1.vector.y").value = 2;
1349
+ root.resolvePath("child1.vector.z").value = 1;
1339
1350
  // Check values
1340
1351
  expect(root._properties.child1.vector.x.value).to.equal(3);
1341
1352
  expect(root._properties.child1.vector.y.value).to.equal(2);
@@ -1346,45 +1357,45 @@ describe('NodeProperty', function () {
1346
1357
  expect(vec3Property.getRoot()).to.equal(root);
1347
1358
  expect(vec3Property._properties.x.getRoot()).to.equal(root);
1348
1359
  // Check paths
1349
- expect(positionProperty.getAbsolutePath()).to.equal('/child1.position');
1350
- expect(positionProperty._properties.x.getAbsolutePath()).to.equal('/child1.position.x');
1351
- expect(vec3Property.getAbsolutePath()).to.equal('/child1.vector');
1352
- expect(vec3Property._properties.x.getAbsolutePath()).to.equal('/child1.vector.x');
1360
+ expect(positionProperty.getAbsolutePath()).to.equal("/child1.position");
1361
+ expect(positionProperty._properties.x.getAbsolutePath()).to.equal("/child1.position.x");
1362
+ expect(vec3Property.getAbsolutePath()).to.equal("/child1.vector");
1363
+ expect(vec3Property._properties.x.getAbsolutePath()).to.equal("/child1.vector.x");
1353
1364
  // Check deletion
1354
- root._properties.child1.propertyNode.remove('position');
1355
- root._properties.child1.propertyNode.remove('vector');
1365
+ root._properties.child1.propertyNode.remove("position");
1366
+ root._properties.child1.propertyNode.remove("vector");
1356
1367
  expect(root._properties.child1.position).to.be.undefined;
1357
- expect(root.resolvePath('child1.position')).to.be.undefined;
1368
+ expect(root.resolvePath("child1.position")).to.be.undefined;
1358
1369
  expect(root._properties.child1.vector).to.be.undefined;
1359
- expect(root.resolvePath('child1.vector')).to.be.undefined;
1370
+ expect(root.resolvePath("child1.vector")).to.be.undefined;
1360
1371
  // Check roots
1361
1372
  expect(positionProperty.getRoot()).to.equal(positionProperty);
1362
1373
  expect(positionProperty._properties.x.getRoot()).to.equal(positionProperty);
1363
1374
  expect(vec3Property.getRoot()).to.equal(vec3Property);
1364
1375
  expect(vec3Property._properties.x.getRoot()).to.equal(vec3Property);
1365
1376
  // Check paths
1366
- expect(positionProperty.getAbsolutePath()).to.equal('/');
1367
- expect(positionProperty._properties.x.getAbsolutePath()).to.equal('/x');
1368
- expect(vec3Property.getAbsolutePath()).to.equal('/');
1369
- expect(vec3Property._properties.x.getAbsolutePath()).to.equal('/x');
1377
+ expect(positionProperty.getAbsolutePath()).to.equal("/");
1378
+ expect(positionProperty._properties.x.getAbsolutePath()).to.equal("/x");
1379
+ expect(vec3Property.getAbsolutePath()).to.equal("/");
1380
+ expect(vec3Property._properties.x.getAbsolutePath()).to.equal("/x");
1370
1381
  // Check addition to a new property root under a different key
1371
- newRoot.insert('newPosition', positionProperty);
1372
- newRoot.insert('newvector', vec3Property);
1382
+ newRoot.insert("newPosition", positionProperty);
1383
+ newRoot.insert("newvector", vec3Property);
1373
1384
  // Check roots
1374
1385
  expect(positionProperty.getRoot()).to.equal(newRoot);
1375
1386
  expect(positionProperty._properties.x.getRoot()).to.equal(newRoot);
1376
1387
  expect(vec3Property.getRoot()).to.equal(newRoot);
1377
1388
  expect(vec3Property._properties.x.getRoot()).to.equal(newRoot);
1378
1389
  // Check paths
1379
- expect(positionProperty.getAbsolutePath()).to.equal('/newPosition');
1380
- expect(positionProperty._properties.x.getAbsolutePath()).to.equal('/newPosition.x');
1381
- expect(vec3Property.getAbsolutePath()).to.equal('/newvector');
1382
- expect(vec3Property._properties.x.getAbsolutePath()).to.equal('/newvector.x');
1390
+ expect(positionProperty.getAbsolutePath()).to.equal("/newPosition");
1391
+ expect(positionProperty._properties.x.getAbsolutePath()).to.equal("/newPosition.x");
1392
+ expect(vec3Property.getAbsolutePath()).to.equal("/newvector");
1393
+ expect(vec3Property._properties.x.getAbsolutePath()).to.equal("/newvector.x");
1383
1394
  // Check keys with characters that require quotations
1384
- newRoot.remove('newPosition');
1385
- newRoot.remove('newvector');
1395
+ newRoot.remove("newPosition");
1396
+ newRoot.remove("newvector");
1386
1397
  newRoot.insert('new"Position', positionProperty);
1387
- newRoot.insert('new.Vector', vec3Property);
1398
+ newRoot.insert("new.Vector", vec3Property);
1388
1399
  // Check paths
1389
1400
  expect(positionProperty.getAbsolutePath()).to.equal('/"new\\"Position"');
1390
1401
  expect(positionProperty._properties.x.getAbsolutePath()).to.equal('/"new\\"Position".x');
@@ -1394,310 +1405,309 @@ describe('NodeProperty', function () {
1394
1405
  expect(newRoot.resolvePath('"new.Vector".x')).to.equal(vec3Property._properties.x);
1395
1406
  newRoot.remove('new"Position');
1396
1407
  // Path resolution for named properties should return the correct path
1397
- var namedProperty = PropertyFactory.create('NamedProperty');
1398
- var nodeProperty = PropertyFactory.create('NodeProperty');
1408
+ var namedProperty = PropertyFactory.create("NamedProperty");
1409
+ var nodeProperty = PropertyFactory.create("NodeProperty");
1399
1410
  nodeProperty.insert(namedProperty);
1400
- expect(namedProperty.getAbsolutePath()).to.equal('/' + namedProperty.getGuid());
1411
+ expect(namedProperty.getAbsolutePath()).to.equal("/" + namedProperty.getGuid());
1401
1412
  expect(nodeProperty.resolvePath(namedProperty.getGuid())).to.equal(namedProperty);
1402
1413
  // Try multiple levels
1403
- var leaf = PropertyFactory.create('NodeProperty');
1404
- expect(leaf.resolvePath('/')).to.equal(leaf);
1405
- var map1 = PropertyFactory.create('NodeProperty');
1406
- map1.insert('entry', leaf);
1407
- expect(leaf.resolvePath('/')).to.equal(map1);
1408
- var map2 = PropertyFactory.create('NodeProperty');
1409
- map2.insert('entry', map1);
1410
- expect(leaf.resolvePath('/')).to.equal(map2);
1411
- var map3 = PropertyFactory.create('NodeProperty');
1412
- map3.insert('entry', map2);
1413
- expect(leaf.resolvePath('/')).to.equal(map3);
1414
+ var leaf = PropertyFactory.create("NodeProperty");
1415
+ expect(leaf.resolvePath("/")).to.equal(leaf);
1416
+ var map1 = PropertyFactory.create("NodeProperty");
1417
+ map1.insert("entry", leaf);
1418
+ expect(leaf.resolvePath("/")).to.equal(map1);
1419
+ var map2 = PropertyFactory.create("NodeProperty");
1420
+ map2.insert("entry", map1);
1421
+ expect(leaf.resolvePath("/")).to.equal(map2);
1422
+ var map3 = PropertyFactory.create("NodeProperty");
1423
+ map3.insert("entry", map2);
1424
+ expect(leaf.resolvePath("/")).to.equal(map3);
1414
1425
  });
1415
1426
  });
1416
- it('should correctly clean templates inheriting from NamedNodeProperty', function () {
1417
- var property = PropertyFactory.create('autodesk.tests:MixedNamedNodeProperty-1.0.0');
1418
- var childProperty = property.get('stringProperty');
1419
- childProperty.value = 'changed';
1427
+ it("should correctly clean templates inheriting from NamedNodeProperty", function () {
1428
+ var property = PropertyFactory.create("autodesk.tests:MixedNamedNodeProperty-1.0.0");
1429
+ var childProperty = property.get("stringProperty");
1430
+ childProperty.value = "changed";
1420
1431
  expect(childProperty.isDirty()).to.be.true;
1421
1432
  property.cleanDirty();
1422
1433
  expect(property.isDirty()).to.be.false;
1423
1434
  expect(childProperty.isDirty()).to.be.false;
1424
1435
  });
1425
- describe('Make sure to have appropriate types for ids given to nodeProperty when inserting', function () {
1426
- it('should be possible for the id passed to be a string', function (done) {
1427
- var node1 = PropertyFactory.create('NodeProperty');
1428
- var node2 = PropertyFactory.create('autodesk.tests:MixedNamedNodeProperty-1.0.0');
1429
- var node3 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
1430
- node1.insert('node', node3);
1431
- node3.insert('node1', node2);
1432
- node2._properties.stringProperty.value = 'test';
1433
- expect(node1.resolvePath('node.node1.stringProperty').value).to.equal('test');
1434
- expect(node3.resolvePath('node1.stringProperty').value).to.equal('test');
1436
+ describe("Make sure to have appropriate types for ids given to nodeProperty when inserting", function () {
1437
+ it("should be possible for the id passed to be a string", function (done) {
1438
+ var node1 = PropertyFactory.create("NodeProperty");
1439
+ var node2 = PropertyFactory.create("autodesk.tests:MixedNamedNodeProperty-1.0.0");
1440
+ var node3 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
1441
+ node1.insert("node", node3);
1442
+ node3.insert("node1", node2);
1443
+ node2._properties.stringProperty.value = "test";
1444
+ expect(node1.resolvePath("node.node1.stringProperty").value).to.equal("test");
1445
+ expect(node3.resolvePath("node1.stringProperty").value).to.equal("test");
1435
1446
  done();
1436
1447
  });
1437
- it('should be possible for the id passed to be a number', function (done) {
1438
- var node1 = PropertyFactory.create('NodeProperty');
1439
- var node2 = PropertyFactory.create('autodesk.tests:MixedNamedNodeProperty-1.0.0');
1440
- var node3 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
1441
- node1.insert('node', node3);
1448
+ it("should be possible for the id passed to be a number", function (done) {
1449
+ var node1 = PropertyFactory.create("NodeProperty");
1450
+ var node2 = PropertyFactory.create("autodesk.tests:MixedNamedNodeProperty-1.0.0");
1451
+ var node3 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
1452
+ node1.insert("node", node3);
1442
1453
  node3.insert(1122, node2);
1443
- node2._properties.stringProperty.value = 'test';
1444
- expect(node1.resolvePath('node.1122.stringProperty').value).to.equal('test');
1445
- expect(node3.resolvePath('1122.stringProperty').value).to.equal('test');
1454
+ node2._properties.stringProperty.value = "test";
1455
+ expect(node1.resolvePath("node.1122.stringProperty").value).to.equal("test");
1456
+ expect(node3.resolvePath("1122.stringProperty").value).to.equal("test");
1446
1457
  done();
1447
1458
  });
1448
- it('should throw an error when the id passed is an object', function (done) {
1449
- var node1 = PropertyFactory.create('NodeProperty');
1450
- var node2 = PropertyFactory.create('autodesk.tests:MixedNamedNodeProperty-1.0.0');
1451
- var node3 = PropertyFactory.create('autodesk.tests:MixedNodeTestProperty-1.0.0');
1452
- node1.insert('node', node3);
1459
+ it("should throw an error when the id passed is an object", function (done) {
1460
+ var node1 = PropertyFactory.create("NodeProperty");
1461
+ var node2 = PropertyFactory.create("autodesk.tests:MixedNamedNodeProperty-1.0.0");
1462
+ var node3 = PropertyFactory.create("autodesk.tests:MixedNodeTestProperty-1.0.0");
1463
+ node1.insert("node", node3);
1453
1464
  try {
1454
- node3.insert({ foo: 'bar' }, node2);
1455
- node2._properties.stringProperty.value = 'test';
1465
+ node3.insert({ foo: "bar" }, node2);
1466
+ node2._properties.stringProperty.value = "test";
1456
1467
  }
1457
1468
  catch (e) {
1458
1469
  done();
1459
1470
  }
1460
1471
  });
1461
1472
  });
1462
- describe('_coveredByPaths', function () {
1473
+ describe("_coveredByPaths", function () {
1463
1474
  this.timeout(500);
1464
1475
  let PathHelper, getPathCoverageSpy, paths, prop, propPath;
1465
1476
  before(function () {
1466
- PathHelper = require('@fluid-experimental/property-changeset').PathHelper;
1477
+ PathHelper = require("@fluid-experimental/property-changeset").PathHelper;
1467
1478
  });
1468
1479
  beforeEach(function () {
1469
- getPathCoverageSpy = sinon.spy(PathHelper, 'getPathCoverage');
1480
+ getPathCoverageSpy = sinon.spy(PathHelper, "getPathCoverage");
1470
1481
  });
1471
1482
  afterEach(function () {
1472
1483
  PathHelper.getPathCoverage.restore();
1473
1484
  });
1474
- after(function () {
1475
- });
1476
- it('should succeed if property is included in a path 1', function () {
1477
- paths = ['a.b'];
1478
- prop = PropertyFactory.create('String');
1479
- propPath = 'a.b';
1485
+ after(function () { });
1486
+ it("should succeed if property is included in a path 1", function () {
1487
+ paths = ["a.b"];
1488
+ prop = PropertyFactory.create("String");
1489
+ propPath = "a.b";
1480
1490
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1481
1491
  expect(getPathCoverageSpy.callCount).to.equal(1);
1482
1492
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1483
1493
  });
1484
- it('should succeed if property is included in a path 2', function () {
1485
- paths = ['a.b'];
1486
- prop = PropertyFactory.create('Int32');
1487
- propPath = 'a.b.c';
1494
+ it("should succeed if property is included in a path 2", function () {
1495
+ paths = ["a.b"];
1496
+ prop = PropertyFactory.create("Int32");
1497
+ propPath = "a.b.c";
1488
1498
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1489
1499
  expect(getPathCoverageSpy.callCount).to.equal(1);
1490
1500
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1491
1501
  });
1492
- it('should succeed if property is a primitive collection included in a path', function () {
1493
- paths = ['a.b'];
1494
- prop = PropertyFactory.create('Int32', 'array');
1495
- propPath = 'a.b.c.d';
1502
+ it("should succeed if property is a primitive collection included in a path", function () {
1503
+ paths = ["a.b"];
1504
+ prop = PropertyFactory.create("Int32", "array");
1505
+ propPath = "a.b.c.d";
1496
1506
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1497
1507
  expect(getPathCoverageSpy.callCount).to.equal(1);
1498
1508
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1499
1509
  });
1500
- it('should fail if property is not included in any path 1', function () {
1501
- paths = ['a.b'];
1502
- prop = PropertyFactory.create('Bool');
1503
- propPath = 'b';
1510
+ it("should fail if property is not included in any path 1", function () {
1511
+ paths = ["a.b"];
1512
+ prop = PropertyFactory.create("Bool");
1513
+ propPath = "b";
1504
1514
  expect(prop._coveredByPaths(propPath, paths)).to.be.false;
1505
1515
  expect(getPathCoverageSpy.callCount).to.equal(1);
1506
1516
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1507
1517
  });
1508
- it('should fail if property is not included in any path 2', function () {
1509
- paths = ['a.b'];
1510
- prop = PropertyFactory.create('Float32');
1511
- propPath = 'b.f.g';
1518
+ it("should fail if property is not included in any path 2", function () {
1519
+ paths = ["a.b"];
1520
+ prop = PropertyFactory.create("Float32");
1521
+ propPath = "b.f.g";
1512
1522
  expect(prop._coveredByPaths(propPath, paths)).to.be.false;
1513
1523
  expect(getPathCoverageSpy.callCount).to.equal(1);
1514
1524
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1515
1525
  });
1516
- it('should fail if property is not included in any path but have common root 1', function () {
1517
- paths = ['a.b'];
1518
- prop = PropertyFactory.create('String', 'map');
1519
- propPath = 'a.h';
1526
+ it("should fail if property is not included in any path but have common root 1", function () {
1527
+ paths = ["a.b"];
1528
+ prop = PropertyFactory.create("String", "map");
1529
+ propPath = "a.h";
1520
1530
  expect(prop._coveredByPaths(propPath, paths)).to.be.false;
1521
1531
  expect(getPathCoverageSpy.callCount).to.equal(1);
1522
1532
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1523
1533
  });
1524
- it('should fail if property is not included in any path but have common root 2', function () {
1525
- paths = ['a.b'];
1526
- prop = PropertyFactory.create('NodeProperty');
1527
- propPath = 'a.i.j';
1534
+ it("should fail if property is not included in any path but have common root 2", function () {
1535
+ paths = ["a.b"];
1536
+ prop = PropertyFactory.create("NodeProperty");
1537
+ propPath = "a.i.j";
1528
1538
  expect(prop._coveredByPaths(propPath, paths)).to.be.false;
1529
1539
  expect(getPathCoverageSpy.callCount).to.equal(1);
1530
1540
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1531
1541
  });
1532
- it('should succeed if path goes through a primitive property 1', function () {
1533
- paths = ['a.b.c', 'a.b.d', 'z'];
1534
- prop = PropertyFactory.create('String');
1535
- propPath = 'a.b';
1542
+ it("should succeed if path goes through a primitive property 1", function () {
1543
+ paths = ["a.b.c", "a.b.d", "z"];
1544
+ prop = PropertyFactory.create("String");
1545
+ propPath = "a.b";
1536
1546
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1537
1547
  expect(getPathCoverageSpy.callCount).to.equal(1);
1538
1548
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1539
1549
  });
1540
- it('should succeed if path goes through a primitive property 2', function () {
1541
- paths = ['a.b.c', 'a.b.d', 'z'];
1542
- prop = PropertyFactory.create('Int32');
1543
- propPath = 'a.b';
1550
+ it("should succeed if path goes through a primitive property 2", function () {
1551
+ paths = ["a.b.c", "a.b.d", "z"];
1552
+ prop = PropertyFactory.create("Int32");
1553
+ propPath = "a.b";
1544
1554
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1545
1555
  expect(getPathCoverageSpy.callCount).to.equal(1);
1546
1556
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1547
1557
  });
1548
- it('should succeed if path goes through a primitive collection property 1', function () {
1549
- paths = ['a.b.c', 'z', 'a.b.d'];
1550
- prop = PropertyFactory.create('Int32', 'map');
1551
- propPath = 'a.b';
1558
+ it("should succeed if path goes through a primitive collection property 1", function () {
1559
+ paths = ["a.b.c", "z", "a.b.d"];
1560
+ prop = PropertyFactory.create("Int32", "map");
1561
+ propPath = "a.b";
1552
1562
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1553
1563
  expect(getPathCoverageSpy.callCount).to.equal(1);
1554
1564
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1555
1565
  });
1556
- it('should succeed if path goes through a primitive collection property 2', function () {
1557
- paths = ['z', 'a.b.c', 'a.b.d'];
1558
- prop = PropertyFactory.create('String', 'array');
1559
- propPath = 'a.b';
1566
+ it("should succeed if path goes through a primitive collection property 2", function () {
1567
+ paths = ["z", "a.b.c", "a.b.d"];
1568
+ prop = PropertyFactory.create("String", "array");
1569
+ propPath = "a.b";
1560
1570
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1561
1571
  expect(getPathCoverageSpy.callCount).to.equal(1);
1562
1572
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1563
1573
  });
1564
- it('should succeed if path goes through a non-primitive collection property 1', function () {
1565
- paths = ['a.b.c', 'z', 'a.b.d'];
1566
- prop = PropertyFactory.create('NodeProperty', 'map');
1567
- propPath = 'a.b';
1574
+ it("should succeed if path goes through a non-primitive collection property 1", function () {
1575
+ paths = ["a.b.c", "z", "a.b.d"];
1576
+ prop = PropertyFactory.create("NodeProperty", "map");
1577
+ propPath = "a.b";
1568
1578
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1569
1579
  expect(getPathCoverageSpy.callCount).to.equal(1);
1570
1580
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1571
1581
  });
1572
- it('should succeed if path goes through a non-primitive collection property 2', function () {
1573
- paths = ['z', 'a.b.c', 'a.b.d'];
1574
- prop = PropertyFactory.create('NamedProperty', 'set');
1575
- propPath = 'a.b';
1582
+ it("should succeed if path goes through a non-primitive collection property 2", function () {
1583
+ paths = ["z", "a.b.c", "a.b.d"];
1584
+ prop = PropertyFactory.create("NamedProperty", "set");
1585
+ propPath = "a.b";
1576
1586
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1577
1587
  expect(getPathCoverageSpy.callCount).to.equal(1);
1578
1588
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1579
1589
  });
1580
- it('should succeed if property is included in multiple paths 1', function () {
1581
- paths = ['a.b.c', 'a.b.d', 'z'];
1582
- prop = PropertyFactory.create('NodeProperty');
1583
- prop.insert('c', PropertyFactory.create('String'));
1584
- prop.insert('d', PropertyFactory.create('String'));
1585
- propPath = 'a.b';
1590
+ it("should succeed if property is included in multiple paths 1", function () {
1591
+ paths = ["a.b.c", "a.b.d", "z"];
1592
+ prop = PropertyFactory.create("NodeProperty");
1593
+ prop.insert("c", PropertyFactory.create("String"));
1594
+ prop.insert("d", PropertyFactory.create("String"));
1595
+ propPath = "a.b";
1586
1596
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1587
1597
  expect(getPathCoverageSpy.callCount).to.equal(3);
1588
1598
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1589
- expect(getPathCoverageSpy.calledWith('a.b.c', ['a.b.c', 'a.b.d'])).to.be.true;
1590
- expect(getPathCoverageSpy.calledWith('a.b.d', ['a.b.c', 'a.b.d'])).to.be.true;
1591
- });
1592
- it('should succeed if property is included in multiple paths 2', function () {
1593
- paths = ['a.b.c', 'z', 'a.b.d'];
1594
- prop = PropertyFactory.create('NodeProperty');
1595
- let c = PropertyFactory.create('NodeProperty');
1596
- prop.insert('c', c);
1597
- c.insert('f', PropertyFactory.create('String'));
1598
- c.insert('g', PropertyFactory.create('String'));
1599
- let d = PropertyFactory.create('String', 'map');
1600
- prop.insert('d', d);
1601
- d.insert('h', 'h');
1602
- d.insert('i', 'i');
1603
- propPath = 'a.b';
1599
+ expect(getPathCoverageSpy.calledWith("a.b.c", ["a.b.c", "a.b.d"])).to.be.true;
1600
+ expect(getPathCoverageSpy.calledWith("a.b.d", ["a.b.c", "a.b.d"])).to.be.true;
1601
+ });
1602
+ it("should succeed if property is included in multiple paths 2", function () {
1603
+ paths = ["a.b.c", "z", "a.b.d"];
1604
+ prop = PropertyFactory.create("NodeProperty");
1605
+ let c = PropertyFactory.create("NodeProperty");
1606
+ prop.insert("c", c);
1607
+ c.insert("f", PropertyFactory.create("String"));
1608
+ c.insert("g", PropertyFactory.create("String"));
1609
+ let d = PropertyFactory.create("String", "map");
1610
+ prop.insert("d", d);
1611
+ d.insert("h", "h");
1612
+ d.insert("i", "i");
1613
+ propPath = "a.b";
1604
1614
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1605
1615
  expect(getPathCoverageSpy.callCount).to.equal(3);
1606
1616
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1607
- expect(getPathCoverageSpy.calledWith('a.b.c', ['a.b.c', 'a.b.d'])).to.be.true;
1608
- expect(getPathCoverageSpy.calledWith('a.b.d', ['a.b.c', 'a.b.d'])).to.be.true;
1609
- });
1610
- it('should succeed if property is included in multiple paths 3', function () {
1611
- paths = ['a.b.c.f', 'a.b.c', 'a.b.d.h', 'a.b.d.i', 'a.z'];
1612
- prop = PropertyFactory.create('NodeProperty');
1613
- let c = PropertyFactory.create('NodeProperty');
1614
- prop.insert('c', c);
1615
- c.insert('f', PropertyFactory.create('String'));
1616
- c.insert('g', PropertyFactory.create('String'));
1617
- let d = PropertyFactory.create('NodeProperty');
1618
- prop.insert('d', d);
1619
- d.insert('h', PropertyFactory.create('String'));
1620
- d.insert('i', PropertyFactory.create('String'));
1621
- propPath = 'a.b';
1617
+ expect(getPathCoverageSpy.calledWith("a.b.c", ["a.b.c", "a.b.d"])).to.be.true;
1618
+ expect(getPathCoverageSpy.calledWith("a.b.d", ["a.b.c", "a.b.d"])).to.be.true;
1619
+ });
1620
+ it("should succeed if property is included in multiple paths 3", function () {
1621
+ paths = ["a.b.c.f", "a.b.c", "a.b.d.h", "a.b.d.i", "a.z"];
1622
+ prop = PropertyFactory.create("NodeProperty");
1623
+ let c = PropertyFactory.create("NodeProperty");
1624
+ prop.insert("c", c);
1625
+ c.insert("f", PropertyFactory.create("String"));
1626
+ c.insert("g", PropertyFactory.create("String"));
1627
+ let d = PropertyFactory.create("NodeProperty");
1628
+ prop.insert("d", d);
1629
+ d.insert("h", PropertyFactory.create("String"));
1630
+ d.insert("i", PropertyFactory.create("String"));
1631
+ propPath = "a.b";
1622
1632
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1623
1633
  expect(getPathCoverageSpy.callCount).to.equal(5);
1624
1634
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1625
- expect(getPathCoverageSpy.calledWith('a.b.c', ['a.b.c.f', 'a.b.c', 'a.b.d.h', 'a.b.d.i'])).to.be.true;
1626
- expect(getPathCoverageSpy.calledWith('a.b.d', ['a.b.c.f', 'a.b.c', 'a.b.d.h', 'a.b.d.i'])).to.be.true;
1627
- expect(getPathCoverageSpy.calledWith('a.b.d.h', ['a.b.d.h', 'a.b.d.i'])).to.be.true;
1628
- expect(getPathCoverageSpy.calledWith('a.b.d.i', ['a.b.d.h', 'a.b.d.i'])).to.be.true;
1629
- });
1630
- it('should succeed if property is included in multiple paths 4', function () {
1631
- paths = ['a.b.c.f', 'a.b.c', 'a.b.d.h', 'a.b.d.i', 'a.z'];
1632
- prop = PropertyFactory.create('NodeProperty');
1633
- let b = PropertyFactory.create('NodeProperty');
1634
- prop.insert('b', b);
1635
- let c = PropertyFactory.create('NodeProperty');
1636
- b.insert('c', c);
1637
- c.insert('f', PropertyFactory.create('String'));
1638
- c.insert('g', PropertyFactory.create('String'));
1639
- let d = PropertyFactory.create('NodeProperty');
1640
- b.insert('d', d);
1641
- d.insert('h', PropertyFactory.create('String'));
1642
- d.insert('i', PropertyFactory.create('String'));
1643
- propPath = 'a';
1635
+ expect(getPathCoverageSpy.calledWith("a.b.c", ["a.b.c.f", "a.b.c", "a.b.d.h", "a.b.d.i"])).to.be.true;
1636
+ expect(getPathCoverageSpy.calledWith("a.b.d", ["a.b.c.f", "a.b.c", "a.b.d.h", "a.b.d.i"])).to.be.true;
1637
+ expect(getPathCoverageSpy.calledWith("a.b.d.h", ["a.b.d.h", "a.b.d.i"])).to.be.true;
1638
+ expect(getPathCoverageSpy.calledWith("a.b.d.i", ["a.b.d.h", "a.b.d.i"])).to.be.true;
1639
+ });
1640
+ it("should succeed if property is included in multiple paths 4", function () {
1641
+ paths = ["a.b.c.f", "a.b.c", "a.b.d.h", "a.b.d.i", "a.z"];
1642
+ prop = PropertyFactory.create("NodeProperty");
1643
+ let b = PropertyFactory.create("NodeProperty");
1644
+ prop.insert("b", b);
1645
+ let c = PropertyFactory.create("NodeProperty");
1646
+ b.insert("c", c);
1647
+ c.insert("f", PropertyFactory.create("String"));
1648
+ c.insert("g", PropertyFactory.create("String"));
1649
+ let d = PropertyFactory.create("NodeProperty");
1650
+ b.insert("d", d);
1651
+ d.insert("h", PropertyFactory.create("String"));
1652
+ d.insert("i", PropertyFactory.create("String"));
1653
+ propPath = "a";
1644
1654
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1645
1655
  expect(getPathCoverageSpy.callCount).to.equal(6);
1646
1656
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1647
- expect(getPathCoverageSpy.calledWith('a.b', paths)).to.be.true;
1648
- expect(getPathCoverageSpy.calledWith('a.b.c', ['a.b.c.f', 'a.b.c', 'a.b.d.h', 'a.b.d.i'])).to.be.true;
1649
- expect(getPathCoverageSpy.calledWith('a.b.d', ['a.b.c.f', 'a.b.c', 'a.b.d.h', 'a.b.d.i'])).to.be.true;
1650
- expect(getPathCoverageSpy.calledWith('a.b.d.h', ['a.b.d.h', 'a.b.d.i'])).to.be.true;
1651
- expect(getPathCoverageSpy.calledWith('a.b.d.i', ['a.b.d.h', 'a.b.d.i'])).to.be.true;
1652
- });
1653
- it('should succeed if property is included in multiple paths through map 1', function () {
1654
- paths = ['a.b.c', 'a.b.d.z', 'z'];
1655
- prop = PropertyFactory.create('String', 'map');
1656
- prop.insert('c', 'c');
1657
- prop.insert('d', 'd');
1658
- propPath = 'a.b';
1657
+ expect(getPathCoverageSpy.calledWith("a.b", paths)).to.be.true;
1658
+ expect(getPathCoverageSpy.calledWith("a.b.c", ["a.b.c.f", "a.b.c", "a.b.d.h", "a.b.d.i"])).to.be.true;
1659
+ expect(getPathCoverageSpy.calledWith("a.b.d", ["a.b.c.f", "a.b.c", "a.b.d.h", "a.b.d.i"])).to.be.true;
1660
+ expect(getPathCoverageSpy.calledWith("a.b.d.h", ["a.b.d.h", "a.b.d.i"])).to.be.true;
1661
+ expect(getPathCoverageSpy.calledWith("a.b.d.i", ["a.b.d.h", "a.b.d.i"])).to.be.true;
1662
+ });
1663
+ it("should succeed if property is included in multiple paths through map 1", function () {
1664
+ paths = ["a.b.c", "a.b.d.z", "z"];
1665
+ prop = PropertyFactory.create("String", "map");
1666
+ prop.insert("c", "c");
1667
+ prop.insert("d", "d");
1668
+ propPath = "a.b";
1659
1669
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1660
1670
  expect(getPathCoverageSpy.callCount).to.equal(3);
1661
1671
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1662
- expect(getPathCoverageSpy.calledWith('a.b.c', ['a.b.c', 'a.b.d.z'])).to.be.true;
1663
- expect(getPathCoverageSpy.calledWith('a.b.d', ['a.b.c', 'a.b.d.z'])).to.be.true;
1664
- });
1665
- it('should succeed if property is included in multiple paths through map 2', function () {
1666
- paths = ['a.b.c.f', 'a.b.c', 'a.b.d.h', 'a.b.d.i', 'a.z'];
1667
- prop = PropertyFactory.create('NodeProperty');
1668
- let c = PropertyFactory.create('NodeProperty');
1669
- let d = PropertyFactory.create('String', 'map');
1670
- prop.insert('c', c);
1671
- c.insert('f', PropertyFactory.create('String'));
1672
- c.insert('g', PropertyFactory.create('String'));
1673
- prop.insert('d', d);
1674
- d.insert('h', 'h');
1675
- d.insert('i', 'i');
1676
- propPath = 'a.b';
1672
+ expect(getPathCoverageSpy.calledWith("a.b.c", ["a.b.c", "a.b.d.z"])).to.be.true;
1673
+ expect(getPathCoverageSpy.calledWith("a.b.d", ["a.b.c", "a.b.d.z"])).to.be.true;
1674
+ });
1675
+ it("should succeed if property is included in multiple paths through map 2", function () {
1676
+ paths = ["a.b.c.f", "a.b.c", "a.b.d.h", "a.b.d.i", "a.z"];
1677
+ prop = PropertyFactory.create("NodeProperty");
1678
+ let c = PropertyFactory.create("NodeProperty");
1679
+ let d = PropertyFactory.create("String", "map");
1680
+ prop.insert("c", c);
1681
+ c.insert("f", PropertyFactory.create("String"));
1682
+ c.insert("g", PropertyFactory.create("String"));
1683
+ prop.insert("d", d);
1684
+ d.insert("h", "h");
1685
+ d.insert("i", "i");
1686
+ propPath = "a.b";
1677
1687
  expect(prop._coveredByPaths(propPath, paths)).to.be.true;
1678
1688
  expect(getPathCoverageSpy.callCount).to.equal(5);
1679
1689
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1680
- expect(getPathCoverageSpy.calledWith('a.b.c', ['a.b.c.f', 'a.b.c', 'a.b.d.h', 'a.b.d.i'])).to.be.true;
1681
- expect(getPathCoverageSpy.calledWith('a.b.d', ['a.b.c.f', 'a.b.c', 'a.b.d.h', 'a.b.d.i'])).to.be.true;
1682
- expect(getPathCoverageSpy.calledWith('a.b.d.h', ['a.b.d.h', 'a.b.d.i'])).to.be.true;
1683
- expect(getPathCoverageSpy.calledWith('a.b.d.i', ['a.b.d.h', 'a.b.d.i'])).to.be.true;
1684
- });
1685
- it('should fail if property is not completely included in multiple paths 1', function () {
1686
- paths = ['a.b.c', 'a.b.d', 'z'];
1687
- prop = PropertyFactory.create('NodeProperty');
1688
- prop.insert('c', PropertyFactory.create('String'));
1689
- prop.insert('e', PropertyFactory.create('String'));
1690
- propPath = 'a.b';
1690
+ expect(getPathCoverageSpy.calledWith("a.b.c", ["a.b.c.f", "a.b.c", "a.b.d.h", "a.b.d.i"])).to.be.true;
1691
+ expect(getPathCoverageSpy.calledWith("a.b.d", ["a.b.c.f", "a.b.c", "a.b.d.h", "a.b.d.i"])).to.be.true;
1692
+ expect(getPathCoverageSpy.calledWith("a.b.d.h", ["a.b.d.h", "a.b.d.i"])).to.be.true;
1693
+ expect(getPathCoverageSpy.calledWith("a.b.d.i", ["a.b.d.h", "a.b.d.i"])).to.be.true;
1694
+ });
1695
+ it("should fail if property is not completely included in multiple paths 1", function () {
1696
+ paths = ["a.b.c", "a.b.d", "z"];
1697
+ prop = PropertyFactory.create("NodeProperty");
1698
+ prop.insert("c", PropertyFactory.create("String"));
1699
+ prop.insert("e", PropertyFactory.create("String"));
1700
+ propPath = "a.b";
1691
1701
  expect(prop._coveredByPaths(propPath, paths)).to.be.false;
1692
1702
  expect(getPathCoverageSpy.callCount).to.be.above(1);
1693
1703
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;
1694
1704
  });
1695
- it('should fail if property is not completely included in multiple paths 2', function () {
1696
- paths = ['z', 'a.b.d', 'a.b.c'];
1697
- prop = PropertyFactory.create('NodeProperty');
1698
- prop.insert('e', PropertyFactory.create('String'));
1699
- prop.insert('c', PropertyFactory.create('String'));
1700
- propPath = 'a.b';
1705
+ it("should fail if property is not completely included in multiple paths 2", function () {
1706
+ paths = ["z", "a.b.d", "a.b.c"];
1707
+ prop = PropertyFactory.create("NodeProperty");
1708
+ prop.insert("e", PropertyFactory.create("String"));
1709
+ prop.insert("c", PropertyFactory.create("String"));
1710
+ propPath = "a.b";
1701
1711
  expect(prop._coveredByPaths(propPath, paths)).to.be.false;
1702
1712
  expect(getPathCoverageSpy.callCount).to.be.above(1);
1703
1713
  expect(getPathCoverageSpy.calledWith(propPath, paths)).to.be.true;