@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
@@ -5,12 +5,12 @@
5
5
  /**
6
6
  * @fileoverview In this file, we will test the set property object described in /src/properties/setProperty.js
7
7
  */
8
- const { ChangeSet } = require('@fluid-experimental/property-changeset');
9
- const { generateGUID } = require('@fluid-experimental/property-common').GuidUtils;
10
- const _ = require('lodash');
11
- const { PropertyFactory } = require('../..');
12
- const { BaseProperty } = require('../..');
13
- describe('SetProperty', function () {
8
+ const { ChangeSet } = require("@fluid-experimental/property-changeset");
9
+ const { generateGUID } = require("@fluid-experimental/property-common").GuidUtils;
10
+ const _ = require("lodash");
11
+ const { PropertyFactory } = require("../..");
12
+ const { BaseProperty } = require("../..");
13
+ describe("SetProperty", function () {
14
14
  var PATH_TOKENS;
15
15
  var changeSetWithTwoChildren, changeSetWithTwoChildren_full, removalChangeSet;
16
16
  var myNode, childNode1, childNode2, children;
@@ -18,24 +18,24 @@ describe('SetProperty', function () {
18
18
  PATH_TOKENS = BaseProperty.PATH_TOKENS;
19
19
  // Register a template with a set property for the tests
20
20
  var TestPropertyTemplate = {
21
- typeid: 'autodesk.tests:TestPropertyID-1.0.0',
22
- inherits: ['NamedProperty'],
21
+ typeid: "autodesk.tests:TestPropertyID-1.0.0",
22
+ inherits: ["NamedProperty"],
23
23
  properties: [
24
- { id: 'stringProperty', typeid: 'String' },
25
- { id: 'stringProperty2', typeid: 'String' },
26
- { id: 'children', context: 'set', typeid: 'NamedProperty' },
24
+ { id: "stringProperty", typeid: "String" },
25
+ { id: "stringProperty2", typeid: "String" },
26
+ { id: "children", context: "set", typeid: "NamedProperty" },
27
27
  ],
28
28
  };
29
29
  PropertyFactory._reregister(TestPropertyTemplate);
30
- myNode = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
31
- childNode1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
32
- childNode2 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
30
+ myNode = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
31
+ childNode1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
32
+ childNode2 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
33
33
  children = myNode._properties.children;
34
34
  });
35
35
  // Helper functions for the test cases
36
36
  // Inserts a node with the given guid (a new one is generated when undefined)
37
37
  var insertNodeInRootWithGuid = function (guid, root) {
38
- var child = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
38
+ var child = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
39
39
  if (guid) {
40
40
  child._properties.guid.value = guid;
41
41
  }
@@ -55,7 +55,7 @@ describe('SetProperty', function () {
55
55
  while (leaf._properties.children.getAsArray().length > 0) {
56
56
  leaf = leaf._properties.children.getAsArray()[0];
57
57
  }
58
- var child = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
58
+ var child = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
59
59
  leaf._properties.children.insert(child);
60
60
  };
61
61
  // Removes the first node from the root
@@ -69,131 +69,156 @@ describe('SetProperty', function () {
69
69
  while (leaf._properties.children.getAsArray().length > 0) {
70
70
  leaf = leaf._properties.children.getAsArray()[0];
71
71
  }
72
- leaf._properties.stringProperty.value = leaf._properties.stringProperty.value + '+';
72
+ leaf._properties.stringProperty.value = leaf._properties.stringProperty.value + "+";
73
73
  };
74
- describe('Testing creation, assignment and serialization', function () {
75
- it('should be empty at the beginning', function () {
74
+ describe("Testing creation, assignment and serialization", function () {
75
+ it("should be empty at the beginning", function () {
76
76
  expect(children.getEntriesReadOnly()).to.be.empty;
77
77
  expect(children._serialize(true)).to.be.empty;
78
78
  });
79
- it('should be possible to insert children', function () {
79
+ it("should be possible to insert children", function () {
80
80
  // Test insertion of the first child
81
81
  children.insert(childNode1);
82
82
  expect(children.has(childNode1.getGuid())).to.be.ok;
83
83
  expect(!children.has(childNode2.getGuid())).to.be.ok;
84
84
  expect(children.get(childNode2.getGuid())).to.equal(undefined);
85
85
  expect(childNode1.getParent()).to.equal(children);
86
- var CS = children.serialize({ 'dirtyOnly': true });
86
+ var CS = children.serialize({ dirtyOnly: true });
87
87
  expect(CS.insert &&
88
- CS.insert['autodesk.tests:TestPropertyID-1.0.0'] &&
89
- _.keys(CS.insert['autodesk.tests:TestPropertyID-1.0.0']).length === 1 &&
90
- _.keys(CS.insert['autodesk.tests:TestPropertyID-1.0.0'])[0] === childNode1.getGuid()).to.be.ok;
88
+ CS.insert["autodesk.tests:TestPropertyID-1.0.0"] &&
89
+ _.keys(CS.insert["autodesk.tests:TestPropertyID-1.0.0"]).length === 1 &&
90
+ _.keys(CS.insert["autodesk.tests:TestPropertyID-1.0.0"])[0] ===
91
+ childNode1.getGuid()).to.be.ok;
91
92
  // Test insertion of the second child
92
93
  children.insert(childNode2);
93
94
  expect(children.has(childNode2.getGuid())).to.be.ok;
94
95
  expect(children.get(childNode2.getGuid())).to.equal(childNode2);
95
- changeSetWithTwoChildren = children.serialize({ 'dirtyOnly': true });
96
+ changeSetWithTwoChildren = children.serialize({ dirtyOnly: true });
96
97
  expect(changeSetWithTwoChildren.insert &&
97
- changeSetWithTwoChildren.insert['autodesk.tests:TestPropertyID-1.0.0'] &&
98
- _.keys(changeSetWithTwoChildren.insert['autodesk.tests:TestPropertyID-1.0.0']).length === 2 &&
99
- _.includes(_.keys(changeSetWithTwoChildren.insert['autodesk.tests:TestPropertyID-1.0.0']), childNode1.getGuid()) &&
100
- _.includes(_.keys(changeSetWithTwoChildren.insert['autodesk.tests:TestPropertyID-1.0.0']), childNode2.getGuid())).to.be.ok;
101
- changeSetWithTwoChildren_full = children.serialize({ 'dirtyOnly': false });
98
+ changeSetWithTwoChildren.insert["autodesk.tests:TestPropertyID-1.0.0"] &&
99
+ _.keys(changeSetWithTwoChildren.insert["autodesk.tests:TestPropertyID-1.0.0"])
100
+ .length === 2 &&
101
+ _.includes(_.keys(changeSetWithTwoChildren.insert["autodesk.tests:TestPropertyID-1.0.0"]), childNode1.getGuid()) &&
102
+ _.includes(_.keys(changeSetWithTwoChildren.insert["autodesk.tests:TestPropertyID-1.0.0"]), childNode2.getGuid())).to.be.ok;
103
+ changeSetWithTwoChildren_full = children.serialize({ dirtyOnly: false });
102
104
  expect(changeSetWithTwoChildren).to.deep.equal(changeSetWithTwoChildren_full);
103
105
  });
104
- it('.get and .resolvePath should work', function () {
106
+ it(".get and .resolvePath should work", function () {
105
107
  expect(children.get(childNode1.getGuid())).to.equal(childNode1);
106
- expect(children.resolvePath('/children[' + childNode1.getGuid() + ']')).to.equal(childNode1);
107
- expect(children.get([PATH_TOKENS.ROOT, 'children', childNode1.getGuid()])).to.equal(childNode1);
108
- expect(children.resolvePath('../children[' + childNode1.getGuid() + ']')).to.equal(childNode1);
109
- expect(children.get([PATH_TOKENS.UP, 'children', childNode1.getGuid()])).to.equal(childNode1);
110
- });
111
- it('.remove should return the item removed', function () {
112
- var myNode1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
113
- var childNode3 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
114
- var childNode4 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
108
+ expect(children.resolvePath("/children[" + childNode1.getGuid() + "]")).to.equal(childNode1);
109
+ expect(children.get([PATH_TOKENS.ROOT, "children", childNode1.getGuid()])).to.equal(childNode1);
110
+ expect(children.resolvePath("../children[" + childNode1.getGuid() + "]")).to.equal(childNode1);
111
+ expect(children.get([PATH_TOKENS.UP, "children", childNode1.getGuid()])).to.equal(childNode1);
112
+ });
113
+ it(".remove should return the item removed", function () {
114
+ var myNode1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
115
+ var childNode3 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
116
+ var childNode4 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
115
117
  var mySet = myNode1._properties.children;
116
118
  mySet.insert(childNode3);
117
119
  mySet.insert(childNode4);
118
120
  expect(mySet.remove(childNode3)).to.deep.equal(childNode3);
119
121
  expect(mySet.remove(childNode4.getGuid())).to.deep.equal(childNode4);
120
122
  });
121
- it('getValues should work', function () {
122
- var myNode1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
123
- var childNode3 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
124
- var childNode4 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
123
+ it("getValues should work", function () {
124
+ var myNode1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
125
+ var childNode3 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
126
+ var childNode4 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
125
127
  var mySet = myNode1._properties.children;
126
128
  mySet.insert(childNode3);
127
129
  mySet.insert(childNode4);
128
130
  var guid = myNode1.getGuid();
129
131
  var guidChild3 = childNode3.getGuid();
130
132
  var guidChild4 = childNode4.getGuid();
131
- expect(function () { myNode1.getValues(); }).to.not.throw();
133
+ expect(function () {
134
+ myNode1.getValues();
135
+ }).to.not.throw();
132
136
  var expectedStr = '{"stringProperty":"",' +
133
137
  '"stringProperty2":"",' +
134
138
  '"children":{"' +
135
- guidChild3 + '":{"stringProperty":"",' +
139
+ guidChild3 +
140
+ '":{"stringProperty":"",' +
136
141
  '"stringProperty2":"",' +
137
142
  '"children":{},' +
138
- '"guid":"' + guidChild3 + '"},' +
139
- '"' + guidChild4 + '":{"stringProperty":"",' +
143
+ '"guid":"' +
144
+ guidChild3 +
145
+ '"},' +
146
+ '"' +
147
+ guidChild4 +
148
+ '":{"stringProperty":"",' +
140
149
  '"stringProperty2":"",' +
141
150
  '"children":{},' +
142
- '"guid":"' + guidChild4 + '"}},' +
143
- '"guid":"' + guid + '"}';
151
+ '"guid":"' +
152
+ guidChild4 +
153
+ '"}},' +
154
+ '"guid":"' +
155
+ guid +
156
+ '"}';
144
157
  expect(JSON.stringify(myNode1.getValues())).to.equal(expectedStr);
145
158
  });
146
- it('should output a pretty string with prettyPrint()', function () {
159
+ it("should output a pretty string with prettyPrint()", function () {
147
160
  var guid = myNode.getGuid();
148
161
  var guidChild1 = childNode1.getGuid();
149
162
  var guidChild2 = childNode2.getGuid();
150
- var expectedPrettyStr = guid + ' (autodesk.tests:TestPropertyID-1.0.0):\n' +
163
+ var expectedPrettyStr = guid +
164
+ " (autodesk.tests:TestPropertyID-1.0.0):\n" +
151
165
  ' stringProperty (String): ""\n' +
152
166
  ' stringProperty2 (String): ""\n' +
153
- ' children (Set of NamedProperty):\n' +
154
- ' ' + guidChild1 + ' (autodesk.tests:TestPropertyID-1.0.0):\n' +
167
+ " children (Set of NamedProperty):\n" +
168
+ " " +
169
+ guidChild1 +
170
+ " (autodesk.tests:TestPropertyID-1.0.0):\n" +
155
171
  ' stringProperty (String): ""\n' +
156
172
  ' stringProperty2 (String): ""\n' +
157
- ' children (Set of NamedProperty):\n' +
158
- ' guid (String): "' + guidChild1 + '"\n' +
159
- ' ' + guidChild2 + ' (autodesk.tests:TestPropertyID-1.0.0):\n' +
173
+ " children (Set of NamedProperty):\n" +
174
+ ' guid (String): "' +
175
+ guidChild1 +
176
+ '"\n' +
177
+ " " +
178
+ guidChild2 +
179
+ " (autodesk.tests:TestPropertyID-1.0.0):\n" +
160
180
  ' stringProperty (String): ""\n' +
161
181
  ' stringProperty2 (String): ""\n' +
162
- ' children (Set of NamedProperty):\n' +
163
- ' guid (String): "' + guidChild2 + '"\n' +
164
- ' guid (String): "' + guid + '"\n';
165
- var prettyStr = '';
182
+ " children (Set of NamedProperty):\n" +
183
+ ' guid (String): "' +
184
+ guidChild2 +
185
+ '"\n' +
186
+ ' guid (String): "' +
187
+ guid +
188
+ '"\n';
189
+ var prettyStr = "";
166
190
  myNode.prettyPrint(function (str) {
167
- prettyStr += str + '\n';
191
+ prettyStr += str + "\n";
168
192
  });
169
193
  expect(prettyStr).to.equal(expectedPrettyStr);
170
194
  });
171
- it('Should track dirtiness', function () {
195
+ it("Should track dirtiness", function () {
172
196
  children.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY);
173
- expect(children._serialize(true, false, BaseProperty.MODIFIED_STATE_FLAGS.DIRTY)).to.be.empty;
197
+ expect(children._serialize(true, false, BaseProperty.MODIFIED_STATE_FLAGS.DIRTY)).to.be
198
+ .empty;
174
199
  expect(children._serialize(true, false, BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE)).deep.equal(changeSetWithTwoChildren_full);
175
- expect(children.serialize({ 'dirtyOnly': false })).deep.equal(changeSetWithTwoChildren_full);
200
+ expect(children.serialize({ dirtyOnly: false })).deep.equal(changeSetWithTwoChildren_full);
176
201
  });
177
- it('Should handle removals correctly', function () {
202
+ it("Should handle removals correctly", function () {
178
203
  children.remove(childNode1);
179
204
  expect(childNode1.getParent()).to.be.undefined;
180
205
  children.remove(childNode2.getGuid());
181
206
  expect(children._serialize(true, false, BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE)).to.be.empty;
182
207
  expect(children._serialize(false)).to.be.empty;
183
208
  removalChangeSet = children.serialize({
184
- 'dirtyOnly': true,
185
- 'includeRootTypeid': false,
186
- 'dirtinessType': BaseProperty.MODIFIED_STATE_FLAGS.DIRTY,
209
+ dirtyOnly: true,
210
+ includeRootTypeid: false,
211
+ dirtinessType: BaseProperty.MODIFIED_STATE_FLAGS.DIRTY,
187
212
  });
188
- expect(removalChangeSet).to.have.all.keys(['remove']);
213
+ expect(removalChangeSet).to.have.all.keys(["remove"]);
189
214
  expect(removalChangeSet.remove).to.have.length(2);
190
215
  expect(removalChangeSet.remove).to.contain(childNode1.getGuid());
191
216
  expect(removalChangeSet.remove).to.contain(childNode1.getGuid());
192
217
  });
193
- it('Should support deserialization', function () {
194
- var deserializedNode = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
218
+ it("Should support deserialization", function () {
219
+ var deserializedNode = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
195
220
  var deserializedChanges1 = deserializedNode._properties.children.deserialize(changeSetWithTwoChildren);
196
- var CS4 = deserializedNode._properties.children.serialize({ 'dirtyOnly': false });
221
+ var CS4 = deserializedNode._properties.children.serialize({ dirtyOnly: false });
197
222
  expect(CS4).to.deep.equal(changeSetWithTwoChildren);
198
223
  expect(deserializedChanges1).to.deep.equal(changeSetWithTwoChildren);
199
224
  var deserializedChanges2 = deserializedNode._properties.children.deserialize(changeSetWithTwoChildren);
@@ -201,145 +226,152 @@ describe('SetProperty', function () {
201
226
  var deserializedChanges3 = deserializedNode._properties.children.deserialize({});
202
227
  expect(deserializedChanges3).to.deep.equal(removalChangeSet);
203
228
  });
204
- it('Should support deserialization for inserts and removes', function () {
205
- var deserializedNode = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
206
- var deserializedNode2 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
207
- var namedProperty = PropertyFactory.create('NamedProperty');
229
+ it("Should support deserialization for inserts and removes", function () {
230
+ var deserializedNode = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
231
+ var deserializedNode2 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
232
+ var namedProperty = PropertyFactory.create("NamedProperty");
208
233
  deserializedNode._properties.children.insert(namedProperty);
209
- deserializedNode2.deserialize(deserializedNode.serialize({ 'dirtyOnly': false }));
210
- expect(deserializedNode2.serialize({ 'dirtyOnly': false })).to.deep.equal(deserializedNode.serialize({ 'dirtyOnly': false }));
234
+ deserializedNode2.deserialize(deserializedNode.serialize({ dirtyOnly: false }));
235
+ expect(deserializedNode2.serialize({ dirtyOnly: false })).to.deep.equal(deserializedNode.serialize({ dirtyOnly: false }));
211
236
  deserializedNode._properties.children.remove(namedProperty);
212
- deserializedNode2.deserialize(deserializedNode.serialize({ 'dirtyOnly': false }));
213
- expect(deserializedNode2.serialize({ 'dirtyOnly': false })).to.deep.equal(deserializedNode.serialize({ 'dirtyOnly': false }));
237
+ deserializedNode2.deserialize(deserializedNode.serialize({ dirtyOnly: false }));
238
+ expect(deserializedNode2.serialize({ dirtyOnly: false })).to.deep.equal(deserializedNode.serialize({ dirtyOnly: false }));
214
239
  });
215
- it('Should track modifies', function () {
216
- var modifyNode1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
217
- var modifyNode2 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
240
+ it("Should track modifies", function () {
241
+ var modifyNode1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
242
+ var modifyNode2 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
218
243
  modifyNode1._properties.children.deserialize(changeSetWithTwoChildren);
219
244
  modifyNode2._properties.children.deserialize(changeSetWithTwoChildren);
220
245
  modifyNode1._properties.children.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
221
246
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
222
247
  var child1 = modifyNode1._properties.children.get(childNode1.getGuid());
223
- child1._properties.stringProperty.value = 'modify test';
248
+ child1._properties.stringProperty.value = "modify test";
224
249
  var modifyChangeSet = modifyNode1._properties.children._serialize(true);
225
250
  modifyNode2._properties.children.applyChangeSet(modifyChangeSet);
226
- expect(modifyNode2._properties.children._serialize(false))
227
- .to.deep.equal(modifyNode1._properties.children._serialize(false));
251
+ expect(modifyNode2._properties.children._serialize(false)).to.deep.equal(modifyNode1._properties.children._serialize(false));
228
252
  });
229
- it('Should support hierarchical properties', function () {
230
- var node1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
231
- var node2 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
232
- var node3 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
253
+ it("Should support hierarchical properties", function () {
254
+ var node1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
255
+ var node2 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
256
+ var node3 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
233
257
  // Create a hierarchy of three nodes
234
258
  node1._properties.children.insert(node2);
235
259
  node2._properties.children.insert(node3);
236
- node3._properties.stringProperty.value = 'test';
260
+ node3._properties.stringProperty.value = "test";
237
261
  // Check that deserializing and serializing works with a hierarchy
238
- var hierarchicalChangeSet = node1.serialize({ 'dirtyOnly': true });
239
- var deserializedNode = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
262
+ var hierarchicalChangeSet = node1.serialize({ dirtyOnly: true });
263
+ var deserializedNode = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
240
264
  deserializedNode.deserialize(hierarchicalChangeSet);
241
265
  var child1 = deserializedNode._properties.children.getAsArray()[0];
242
266
  expect(child1).to.not.equal(undefined);
243
267
  var child2 = child1._properties.children.getAsArray()[0];
244
268
  expect(child2).to.not.equal(undefined);
245
- expect(child2._properties.stringProperty.value).to.equal('test');
269
+ expect(child2._properties.stringProperty.value).to.equal("test");
246
270
  // Test that hierarchical modifies work
247
271
  node1.cleanDirty();
248
- node3._properties.stringProperty.value = 'test2';
249
- var hierarchicalModifyChangeSet = node1.serialize({ 'dirtyOnly': true });
272
+ node3._properties.stringProperty.value = "test2";
273
+ var hierarchicalModifyChangeSet = node1.serialize({ dirtyOnly: true });
250
274
  deserializedNode.applyChangeSet(hierarchicalModifyChangeSet);
251
275
  child1 = deserializedNode._properties.children.getAsArray()[0];
252
276
  expect(child1).to.not.equal(undefined);
253
277
  child2 = child1._properties.children.getAsArray()[0];
254
278
  expect(child2).to.not.equal(undefined);
255
- expect(child2._properties.stringProperty.value).to.equal('test2');
279
+ expect(child2._properties.stringProperty.value).to.equal("test2");
256
280
  });
257
- it('adding a NamedNodeProperty should be possible', function () {
258
- var set = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0')._properties.children;
259
- var namedNodeProp = PropertyFactory.create('NamedNodeProperty');
281
+ it("adding a NamedNodeProperty should be possible", function () {
282
+ var set = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0")._properties
283
+ .children;
284
+ var namedNodeProp = PropertyFactory.create("NamedNodeProperty");
260
285
  set.insert(namedNodeProp);
261
286
  expect(set.has(namedNodeProp.getGuid())).to.be.true;
262
287
  expect(set.get(namedNodeProp.getGuid())).to.equal(namedNodeProp);
263
288
  });
264
- it('path creation and resolution should work for entries of the map', function () {
265
- var rootNode = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
266
- var node = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
289
+ it("path creation and resolution should work for entries of the map", function () {
290
+ var rootNode = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
291
+ var node = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
267
292
  rootNode._properties.children.insert(node);
268
293
  // Test whether the returned paths are correct
269
- expect(node.getAbsolutePath()).to.equal('/children[' + node.getGuid() + ']');
270
- expect(node.getRelativePath(node)).to.equal('');
271
- expect(node.getRelativePath(rootNode.resolvePath('children'))).to.equal('[' + node.getGuid() + ']');
272
- expect(rootNode.getRelativePath(node)).to.equal('../../');
273
- expect(rootNode.resolvePath('children[' + node.getGuid() + ']')).to.equal(node);
274
- expect(rootNode.resolvePath('children').resolvePath('[' + node.getGuid() + ']')).to.equal(node);
294
+ expect(node.getAbsolutePath()).to.equal("/children[" + node.getGuid() + "]");
295
+ expect(node.getRelativePath(node)).to.equal("");
296
+ expect(node.getRelativePath(rootNode.resolvePath("children"))).to.equal("[" + node.getGuid() + "]");
297
+ expect(rootNode.getRelativePath(node)).to.equal("../../");
298
+ expect(rootNode.resolvePath("children[" + node.getGuid() + "]")).to.equal(node);
299
+ expect(rootNode.resolvePath("children").resolvePath("[" + node.getGuid() + "]")).to.equal(node);
275
300
  // Test whether they are updated correctly
276
301
  rootNode._properties.children.remove(node);
277
302
  // After removal the old paths should be undefined
278
- expect(rootNode.resolvePath('children[' + node.getGuid() + ']')).to.be.undefined;
279
- expect(rootNode.resolvePath('children').resolvePath('[' + node.getGuid() + ']')).to.be.undefined;
303
+ expect(rootNode.resolvePath("children[" + node.getGuid() + "]")).to.be.undefined;
304
+ expect(rootNode.resolvePath("children").resolvePath("[" + node.getGuid() + "]")).to.be
305
+ .undefined;
280
306
  // And the node should have an empty absolute path
281
- expect(node.getAbsolutePath()).to.equal('/');
307
+ expect(node.getAbsolutePath()).to.equal("/");
282
308
  });
283
- describe('Setting values', function () {
309
+ describe("Setting values", function () {
284
310
  before(function () {
285
311
  var SetValueEntryTemplate = {
286
- typeid: 'autodesk.tests:SetValueEntry-1.0.0',
287
- inherits: ['NamedProperty'],
288
- properties: [{ id: 'string', typeid: 'String' }],
312
+ typeid: "autodesk.tests:SetValueEntry-1.0.0",
313
+ inherits: ["NamedProperty"],
314
+ properties: [{ id: "string", typeid: "String" }],
289
315
  };
290
316
  var SetValueTemplate = {
291
- typeid: 'autodesk.tests:SetValue-1.0.0',
292
- properties: [{ id: 'set', typeid: 'autodesk.tests:SetValueEntry-1.0.0', context: 'set' }],
317
+ typeid: "autodesk.tests:SetValue-1.0.0",
318
+ properties: [
319
+ { id: "set", typeid: "autodesk.tests:SetValueEntry-1.0.0", context: "set" },
320
+ ],
293
321
  };
294
322
  PropertyFactory.register(SetValueEntryTemplate);
295
323
  PropertyFactory.register(SetValueTemplate);
296
324
  });
297
- it('should set values for a list of property inputs', function () {
298
- var setValueEntry1 = PropertyFactory.create('autodesk.tests:SetValueEntry-1.0.0', null, {
299
- string: 'I am a string 1',
325
+ it("should set values for a list of property inputs", function () {
326
+ var setValueEntry1 = PropertyFactory.create("autodesk.tests:SetValueEntry-1.0.0", null, {
327
+ string: "I am a string 1",
300
328
  });
301
- var setValueEntry2 = PropertyFactory.create('autodesk.tests:SetValueEntry-1.0.0', null, {
302
- string: 'I am a string 2',
329
+ var setValueEntry2 = PropertyFactory.create("autodesk.tests:SetValueEntry-1.0.0", null, {
330
+ string: "I am a string 2",
303
331
  });
304
- var setValue = PropertyFactory.create('autodesk.tests:SetValue-1.0.0');
305
- setValue.get('set').setValues([setValueEntry1, setValueEntry2]);
306
- expect(setValue.get('set').getAsArray().length).to.equal(2);
307
- expect(setValue.get('set').getAsArray()[0].get('string').getValue()).to.equal('I am a string 1');
308
- expect(setValue.get('set').getAsArray()[1].get('string').getValue()).to.equal('I am a string 2');
332
+ var setValue = PropertyFactory.create("autodesk.tests:SetValue-1.0.0");
333
+ setValue.get("set").setValues([setValueEntry1, setValueEntry2]);
334
+ expect(setValue.get("set").getAsArray().length).to.equal(2);
335
+ expect(setValue.get("set").getAsArray()[0].get("string").getValue()).to.equal("I am a string 1");
336
+ expect(setValue.get("set").getAsArray()[1].get("string").getValue()).to.equal("I am a string 2");
309
337
  });
310
- it('should set values for a list of untyped inputs', function () {
311
- var setValue = PropertyFactory.create('autodesk.tests:SetValue-1.0.0');
312
- setValue.get('set').setValues([{ string: 'I am a string 1' }, { string: 'I am a string 2' }]);
313
- expect(setValue.get('set').getAsArray().length).to.equal(2);
314
- expect(setValue.get('set').getAsArray()[0].get('string').getValue()).to.equal('I am a string 1');
315
- expect(setValue.get('set').getAsArray()[1].get('string').getValue()).to.equal('I am a string 2');
338
+ it("should set values for a list of untyped inputs", function () {
339
+ var setValue = PropertyFactory.create("autodesk.tests:SetValue-1.0.0");
340
+ setValue
341
+ .get("set")
342
+ .setValues([{ string: "I am a string 1" }, { string: "I am a string 2" }]);
343
+ expect(setValue.get("set").getAsArray().length).to.equal(2);
344
+ expect(setValue.get("set").getAsArray()[0].get("string").getValue()).to.equal("I am a string 1");
345
+ expect(setValue.get("set").getAsArray()[1].get("string").getValue()).to.equal("I am a string 2");
316
346
  });
317
- it('should update values for existing keys and create new ones for non-existing keys', function () {
318
- var setValueEntry1 = PropertyFactory.create('autodesk.tests:SetValueEntry-1.0.0', null, {
319
- string: 'I am a string 1',
347
+ it("should update values for existing keys and create new ones for non-existing keys", function () {
348
+ var setValueEntry1 = PropertyFactory.create("autodesk.tests:SetValueEntry-1.0.0", null, {
349
+ string: "I am a string 1",
320
350
  });
321
- var setValueEntry2 = PropertyFactory.create('autodesk.tests:SetValueEntry-1.0.0', null, {
322
- string: 'I am a string 2',
351
+ var setValueEntry2 = PropertyFactory.create("autodesk.tests:SetValueEntry-1.0.0", null, {
352
+ string: "I am a string 2",
323
353
  });
324
- var setValue = PropertyFactory.create('autodesk.tests:SetValue-1.0.0');
325
- setValue.get('set').setValues([setValueEntry1, setValueEntry2]);
326
- setValueEntry1.get('string').setValue('I am a string 1, overriden');
327
- setValue.get('set').setValues([setValueEntry1, setValueEntry2, { string: 'I am a string 3' }]);
328
- expect(setValue.get('set').getAsArray().length).to.equal(3);
329
- expect(setValue.get('set').getAsArray()[0].get('string').getValue()).to.equal('I am a string 1, overriden');
330
- expect(setValue.get('set').getAsArray()[1].get('string').getValue()).to.equal('I am a string 2');
331
- expect(setValue.get('set').getAsArray()[2].get('string').getValue()).to.equal('I am a string 3');
332
- setValueEntry2.get('string').setValue('I am a string 2, overriden');
333
- setValue.get('set').setValues([{ string: 'I am a string 4' }, setValueEntry2]);
334
- expect(setValue.get('set').getAsArray().length).to.equal(4);
335
- expect(setValue.get('set').getAsArray()[0].get('string').getValue()).to.equal('I am a string 1, overriden');
336
- expect(setValue.get('set').getAsArray()[3].get('string').getValue()).to.equal('I am a string 2, overriden');
337
- expect(setValue.get('set').getAsArray()[1].get('string').getValue()).to.equal('I am a string 3');
338
- expect(setValue.get('set').getAsArray()[2].get('string').getValue()).to.equal('I am a string 4');
354
+ var setValue = PropertyFactory.create("autodesk.tests:SetValue-1.0.0");
355
+ setValue.get("set").setValues([setValueEntry1, setValueEntry2]);
356
+ setValueEntry1.get("string").setValue("I am a string 1, overriden");
357
+ setValue
358
+ .get("set")
359
+ .setValues([setValueEntry1, setValueEntry2, { string: "I am a string 3" }]);
360
+ expect(setValue.get("set").getAsArray().length).to.equal(3);
361
+ expect(setValue.get("set").getAsArray()[0].get("string").getValue()).to.equal("I am a string 1, overriden");
362
+ expect(setValue.get("set").getAsArray()[1].get("string").getValue()).to.equal("I am a string 2");
363
+ expect(setValue.get("set").getAsArray()[2].get("string").getValue()).to.equal("I am a string 3");
364
+ setValueEntry2.get("string").setValue("I am a string 2, overriden");
365
+ setValue.get("set").setValues([{ string: "I am a string 4" }, setValueEntry2]);
366
+ expect(setValue.get("set").getAsArray().length).to.equal(4);
367
+ expect(setValue.get("set").getAsArray()[0].get("string").getValue()).to.equal("I am a string 1, overriden");
368
+ expect(setValue.get("set").getAsArray()[3].get("string").getValue()).to.equal("I am a string 2, overriden");
369
+ expect(setValue.get("set").getAsArray()[1].get("string").getValue()).to.equal("I am a string 3");
370
+ expect(setValue.get("set").getAsArray()[2].get("string").getValue()).to.equal("I am a string 4");
339
371
  });
340
372
  });
341
373
  });
342
- describe('squashing', function () {
374
+ describe("squashing", function () {
343
375
  //
344
376
  // Helper function which takes a sequence of callbacks that are successively executed
345
377
  // and the changes applied by the callbacks are separately tracked and squashed in a
@@ -349,19 +381,19 @@ describe('SetProperty', function () {
349
381
  // be given as first parameter
350
382
  //
351
383
  var testChangeSetSquashing = function (in_options) {
352
- var testProperty = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
384
+ var testProperty = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
353
385
  var callbacks = in_options.callbacks;
354
386
  if (in_options.pre) {
355
387
  in_options.pre(testProperty);
356
388
  }
357
- var initialChangeset = new ChangeSet(testProperty.serialize({ 'dirtyOnly': false }));
389
+ var initialChangeset = new ChangeSet(testProperty.serialize({ dirtyOnly: false }));
358
390
  initialChangeset.setIsNormalized(true);
359
391
  var squashedChangeset = new ChangeSet();
360
392
  testProperty.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
361
393
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
362
394
  for (var i = 0; i < callbacks.length; i++) {
363
395
  callbacks[i](testProperty);
364
- var changes = testProperty.serialize({ 'dirtyOnly': true });
396
+ var changes = testProperty.serialize({ dirtyOnly: true });
365
397
  testProperty.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
366
398
  BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);
367
399
  squashedChangeset.applyChangeSet(changes);
@@ -372,62 +404,88 @@ describe('SetProperty', function () {
372
404
  initialChangeset.applyChangeSet(squashedChangeset.getSerializedChangeSet());
373
405
  expect(initialChangeset.getSerializedChangeSet()).to.deep.equal(testProperty.serialize());
374
406
  };
375
- it('should work for multiple independent inserts', function () {
376
- testChangeSetSquashing({ callbacks: [insertNodeInRoot, insertNodeInRoot, insertNodeInRoot] });
407
+ it("should work for multiple independent inserts", function () {
408
+ testChangeSetSquashing({
409
+ callbacks: [insertNodeInRoot, insertNodeInRoot, insertNodeInRoot],
410
+ });
377
411
  });
378
- it('should work for multiple hierarchical inserts', function () {
379
- testChangeSetSquashing({ callbacks: [insertNodeAsLeaf, insertNodeAsLeaf, insertNodeAsLeaf] });
412
+ it("should work for multiple hierarchical inserts", function () {
413
+ testChangeSetSquashing({
414
+ callbacks: [insertNodeAsLeaf, insertNodeAsLeaf, insertNodeAsLeaf],
415
+ });
380
416
  });
381
- it('should work for inserts followed by removes', function () {
417
+ it("should work for inserts followed by removes", function () {
382
418
  testChangeSetSquashing({
383
- callbacks: [insertNodeInRoot, insertNodeInRoot, removeFirstNodeInRoot, removeFirstNodeInRoot],
419
+ callbacks: [
420
+ insertNodeInRoot,
421
+ insertNodeInRoot,
422
+ removeFirstNodeInRoot,
423
+ removeFirstNodeInRoot,
424
+ ],
384
425
  post: function (changeset) {
385
426
  expect(changeset).to.be.empty;
386
427
  },
387
428
  });
388
429
  });
389
- it('should work for a tree removal', function () {
430
+ it("should work for a tree removal", function () {
390
431
  testChangeSetSquashing({
391
- callbacks: [insertNodeAsLeaf, insertNodeAsLeaf, insertNodeAsLeaf, removeFirstNodeInRoot],
432
+ callbacks: [
433
+ insertNodeAsLeaf,
434
+ insertNodeAsLeaf,
435
+ insertNodeAsLeaf,
436
+ removeFirstNodeInRoot,
437
+ ],
392
438
  post: function (changeset) {
393
439
  expect(changeset).to.be.empty;
394
440
  },
395
441
  });
396
442
  });
397
- it('should work for modifies in a tree', function () {
443
+ it("should work for modifies in a tree", function () {
398
444
  testChangeSetSquashing({
399
- callbacks: [insertNodeAsLeaf, insertNodeAsLeaf, insertNodeAsLeaf, modifyLeaf, modifyLeaf],
445
+ callbacks: [
446
+ insertNodeAsLeaf,
447
+ insertNodeAsLeaf,
448
+ insertNodeAsLeaf,
449
+ modifyLeaf,
450
+ modifyLeaf,
451
+ ],
400
452
  });
401
453
  });
402
- it('an insert, modify and a remove should give an empty changeset', function () {
454
+ it("an insert, modify and a remove should give an empty changeset", function () {
403
455
  testChangeSetSquashing({
404
- callbacks: [insertNodeAsLeaf, insertNodeAsLeaf, modifyLeaf, modifyLeaf, removeFirstNodeInRoot],
456
+ callbacks: [
457
+ insertNodeAsLeaf,
458
+ insertNodeAsLeaf,
459
+ modifyLeaf,
460
+ modifyLeaf,
461
+ removeFirstNodeInRoot,
462
+ ],
405
463
  post: function (changeset) {
406
464
  expect(changeset).to.be.empty;
407
465
  },
408
466
  });
409
467
  });
410
- it('work for modifies after an already existing insert', function () {
468
+ it("work for modifies after an already existing insert", function () {
411
469
  testChangeSetSquashing({
412
470
  pre: insertNodeInRoot,
413
471
  callbacks: [modifyLeaf, modifyLeaf],
414
472
  });
415
473
  });
416
- it('of modify and remove after an already existing insert should work', function () {
474
+ it("of modify and remove after an already existing insert should work", function () {
417
475
  testChangeSetSquashing({
418
476
  pre: insertNodeInRoot,
419
477
  callbacks: [modifyLeaf, removeFirstNodeInRoot],
420
478
  post: function (changeset) {
421
- expect(changeset['set<NamedProperty>'].children).to.have.all.keys('remove');
479
+ expect(changeset["set<NamedProperty>"].children).to.have.all.keys("remove");
422
480
  },
423
481
  });
424
482
  });
425
- it('of a replace operation should be possible', function () {
483
+ it("of a replace operation should be possible", function () {
426
484
  // Create two nodes with the same GUID
427
- var node1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
428
- var node2 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
485
+ var node1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
486
+ var node2 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
429
487
  node2._properties.guid.value = node1._properties.guid.value;
430
- node2._properties.stringProperty.value = 'testString2';
488
+ node2._properties.stringProperty.value = "testString2";
431
489
  testChangeSetSquashing({
432
490
  pre: function (root) {
433
491
  root._properties.children.insert(node1);
@@ -439,22 +497,22 @@ describe('SetProperty', function () {
439
497
  },
440
498
  ],
441
499
  post: function (changeset) {
442
- expect(changeset['set<NamedProperty>'].children).to.have.all.keys('remove', 'insert');
500
+ expect(changeset["set<NamedProperty>"].children).to.have.all.keys("remove", "insert");
443
501
  },
444
502
  });
445
503
  });
446
504
  });
447
- describe('Rebasing', function () {
505
+ describe("Rebasing", function () {
448
506
  var testRebasing = function (in_options) {
449
507
  // Prepare the initial state
450
- var baseProperty1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
508
+ var baseProperty1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
451
509
  if (in_options.prepare) {
452
510
  in_options.prepare(baseProperty1);
453
511
  }
454
512
  // Create two copies of this state
455
- var baseProperty2 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
513
+ var baseProperty2 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
456
514
  baseProperty2.deserialize(baseProperty1.serialize());
457
- var baseProperty3 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
515
+ var baseProperty3 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
458
516
  baseProperty3.deserialize(baseProperty1.serialize());
459
517
  // Make sure the states are clear
460
518
  baseProperty1.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |
@@ -472,8 +530,8 @@ describe('SetProperty', function () {
472
530
  in_options.op2(baseProperty2);
473
531
  }
474
532
  // Get the ChangeSets
475
- var changeSet1 = new ChangeSet(baseProperty1.serialize({ 'dirtyOnly': true }));
476
- var changeSet2 = baseProperty2.serialize({ 'dirtyOnly': true });
533
+ var changeSet1 = new ChangeSet(baseProperty1.serialize({ dirtyOnly: true }));
534
+ var changeSet2 = baseProperty2.serialize({ dirtyOnly: true });
477
535
  // Perform the actual rebase
478
536
  var conflicts = [];
479
537
  changeSet1._rebaseChangeSet(changeSet2, conflicts);
@@ -488,29 +546,29 @@ describe('SetProperty', function () {
488
546
  if (in_options.op2) {
489
547
  in_options.op2(baseProperty3);
490
548
  }
491
- var finalChangeSet = baseProperty3.serialize({ 'dirtyOnly': false });
549
+ var finalChangeSet = baseProperty3.serialize({ dirtyOnly: false });
492
550
  expect(finalChangeSet).to.be.deep.equal(combinedChangeSet.getSerializedChangeSet());
493
551
  }
494
552
  if (in_options.checkResult) {
495
553
  in_options.checkResult(conflicts, changeSet2, combinedChangeSet);
496
554
  }
497
555
  };
498
- it('with a NOP should be possible', function () {
556
+ it("with a NOP should be possible", function () {
499
557
  testRebasing({
500
558
  op2: insertUniqueNodeInRoot(),
501
559
  compareToSequential: true,
502
560
  });
503
561
  });
504
- it('with independent inserts should be possible', function () {
562
+ it("with independent inserts should be possible", function () {
505
563
  testRebasing({
506
564
  op1: insertUniqueNodeInRoot(),
507
565
  op2: insertUniqueNodeInRoot(),
508
566
  compareToSequential: true,
509
567
  });
510
568
  });
511
- it('with independent removes should be possible', function () {
512
- var node1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
513
- var node2 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
569
+ it("with independent removes should be possible", function () {
570
+ var node1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
571
+ var node2 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
514
572
  testRebasing({
515
573
  prepare: function (root) {
516
574
  root._properties.children.insert(node1);
@@ -525,8 +583,8 @@ describe('SetProperty', function () {
525
583
  compareToSequential: true,
526
584
  });
527
585
  });
528
- it('with a modify and a remove should possible', function () {
529
- var node1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
586
+ it("with a modify and a remove should possible", function () {
587
+ var node1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
530
588
  testRebasing({
531
589
  prepare: function (root) {
532
590
  root._properties.children.insert(node1);
@@ -536,8 +594,8 @@ describe('SetProperty', function () {
536
594
  compareToSequential: true,
537
595
  });
538
596
  });
539
- it('with a remove and a modify should possible', function () {
540
- var node1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
597
+ it("with a remove and a modify should possible", function () {
598
+ var node1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
541
599
  testRebasing({
542
600
  prepare: function (root) {
543
601
  root._properties.children.insert(node1);
@@ -548,13 +606,13 @@ describe('SetProperty', function () {
548
606
  checkResult: function (conflicts, changeSet) {
549
607
  expect(conflicts).to.have.length(1);
550
608
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.ENTRY_MODIFIED_AFTER_REMOVE);
551
- expect(conflicts[0].path).to.be.equal('children[' + node1.getGuid() + ']');
609
+ expect(conflicts[0].path).to.be.equal("children[" + node1.getGuid() + "]");
552
610
  expect(ChangeSet.isEmptyChangeSet(changeSet)).to.be.ok;
553
611
  },
554
612
  });
555
613
  });
556
- it('with two compatible removes should be possible', function () {
557
- var node1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
614
+ it("with two compatible removes should be possible", function () {
615
+ var node1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
558
616
  testRebasing({
559
617
  prepare: function (root) {
560
618
  root._properties.children.insert(node1);
@@ -571,17 +629,19 @@ describe('SetProperty', function () {
571
629
  },
572
630
  });
573
631
  });
574
- it('with two indendent recursive modifies should be possible', function () {
575
- var node1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
632
+ it("with two indendent recursive modifies should be possible", function () {
633
+ var node1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
576
634
  testRebasing({
577
635
  prepare: function (root) {
578
636
  root._properties.children.insert(node1);
579
637
  },
580
638
  op1: function (root) {
581
- root._properties.children.getAsArray()[0]._properties.stringProperty.value = 'a';
639
+ root._properties.children.getAsArray()[0]._properties.stringProperty.value =
640
+ "a";
582
641
  },
583
642
  op2: function (root) {
584
- root._properties.children.getAsArray()[0]._properties.stringProperty2.value = 'a';
643
+ root._properties.children.getAsArray()[0]._properties.stringProperty2.value =
644
+ "a";
585
645
  },
586
646
  compareToSequential: true,
587
647
  checkResult: function (conflicts, changeSet) {
@@ -589,36 +649,38 @@ describe('SetProperty', function () {
589
649
  },
590
650
  });
591
651
  });
592
- it('with two conflicting recursive modifies should be possible and report a conflict', function () {
593
- var node1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
652
+ it("with two conflicting recursive modifies should be possible and report a conflict", function () {
653
+ var node1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
594
654
  testRebasing({
595
655
  prepare: function (root) {
596
656
  root._properties.children.insert(node1);
597
657
  },
598
658
  op1: function (root) {
599
- root._properties.children.getAsArray()[0]._properties.stringProperty.value = 'a';
659
+ root._properties.children.getAsArray()[0]._properties.stringProperty.value =
660
+ "a";
600
661
  },
601
662
  op2: function (root) {
602
- root._properties.children.getAsArray()[0]._properties.stringProperty.value = 'a';
663
+ root._properties.children.getAsArray()[0]._properties.stringProperty.value =
664
+ "a";
603
665
  },
604
666
  compareToSequential: true,
605
667
  checkResult: function (conflicts, changeSet) {
606
668
  expect(conflicts).to.have.length(1);
607
669
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);
608
- expect(conflicts[0].path).to.be.equal('children[' + node1.getGuid() + '].stringProperty');
670
+ expect(conflicts[0].path).to.be.equal("children[" + node1.getGuid() + "].stringProperty");
609
671
  },
610
672
  });
611
673
  });
612
- it('with modify followed by remove+insert should work', function () {
674
+ it("with modify followed by remove+insert should work", function () {
613
675
  var node1;
614
676
  testRebasing({
615
677
  prepare: function (root) {
616
- node1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
678
+ node1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
617
679
  root._properties.children.insert(node1);
618
680
  },
619
681
  op1: modifyLeaf,
620
682
  op2: function (root) {
621
- var node2 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
683
+ var node2 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
622
684
  node2._properties.guid.value = node1._properties.guid.value;
623
685
  root._properties.children.remove(node1);
624
686
  root._properties.children.insert(node2);
@@ -627,19 +689,19 @@ describe('SetProperty', function () {
627
689
  checkResult: function (conflicts, changeSet) {
628
690
  expect(conflicts).to.have.length(1);
629
691
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.REMOVE_AFTER_MODIFY);
630
- expect(conflicts[0].path).to.be.equal('children[' + node1.getGuid() + ']');
631
- expect(changeSet['set<NamedProperty>'].children).to.have.all.keys('remove', 'insert');
692
+ expect(conflicts[0].path).to.be.equal("children[" + node1.getGuid() + "]");
693
+ expect(changeSet["set<NamedProperty>"].children).to.have.all.keys("remove", "insert");
632
694
  },
633
695
  });
634
696
  });
635
- it('with remove+insert followed by modify should report conflict', function () {
636
- var node1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
697
+ it("with remove+insert followed by modify should report conflict", function () {
698
+ var node1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
637
699
  testRebasing({
638
700
  prepare: function (root) {
639
701
  root._properties.children.insert(node1);
640
702
  },
641
703
  op1: function (root) {
642
- var node2 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
704
+ var node2 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
643
705
  node2._properties.guid.value = node1._properties.guid.value;
644
706
  root._properties.children.remove(node1);
645
707
  root._properties.children.insert(node2);
@@ -649,14 +711,14 @@ describe('SetProperty', function () {
649
711
  checkResult: function (conflicts, changeSet) {
650
712
  expect(conflicts).to.have.length(1);
651
713
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.ENTRY_MODIFICATION_AFTER_REMOVE_INSERT);
652
- expect(conflicts[0].path).to.be.equal('children[' + node1.getGuid() + ']');
714
+ expect(conflicts[0].path).to.be.equal("children[" + node1.getGuid() + "]");
653
715
  },
654
716
  });
655
717
  });
656
- it('with remove+insert followed by remove+insert should report conflict', function () {
657
- var node = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
658
- var node1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
659
- var node2 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
718
+ it("with remove+insert followed by remove+insert should report conflict", function () {
719
+ var node = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
720
+ var node1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
721
+ var node2 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
660
722
  node1._properties.guid.value = node._properties.guid.value;
661
723
  node2._properties.guid.value = node._properties.guid.value;
662
724
  testRebasing({
@@ -673,17 +735,16 @@ describe('SetProperty', function () {
673
735
  checkResult: function (conflicts, changeSet) {
674
736
  expect(conflicts).to.have.length(1);
675
737
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);
676
- expect(conflicts[0].path).to.be.equal('children[' + node.getGuid() + ']');
738
+ expect(conflicts[0].path).to.be.equal("children[" + node.getGuid() + "]");
677
739
  },
678
740
  });
679
741
  });
680
- it('with conflicting inserts should report conflict', function () {
681
- var node1 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
682
- var node2 = PropertyFactory.create('autodesk.tests:TestPropertyID-1.0.0');
742
+ it("with conflicting inserts should report conflict", function () {
743
+ var node1 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
744
+ var node2 = PropertyFactory.create("autodesk.tests:TestPropertyID-1.0.0");
683
745
  node2._properties.guid.value = node1._properties.guid.value;
684
746
  testRebasing({
685
- prepare: function (root) {
686
- },
747
+ prepare: function (root) { },
687
748
  op1: function (root) {
688
749
  root._properties.children.insert(node1);
689
750
  },
@@ -695,7 +756,7 @@ describe('SetProperty', function () {
695
756
  expect(ChangeSet.isEmptyChangeSet(changeSet)).to.be.ok;
696
757
  expect(conflicts).to.have.length(1);
697
758
  expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.INSERTED_ENTRY_WITH_SAME_KEY);
698
- expect(conflicts[0].path).to.be.equal('children[' + node1.getGuid() + ']');
759
+ expect(conflicts[0].path).to.be.equal("children[" + node1.getGuid() + "]");
699
760
  },
700
761
  });
701
762
  });