@fluid-experimental/property-properties 0.57.1 → 0.58.0-55561

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.
@@ -21,7 +21,6 @@ describe('Test EnumProperty', function () {
21
21
  deepCopy = _.cloneDeep;
22
22
  // the following templates are copies from the specification
23
23
  // disableling the single quote rule to keep exact copies
24
- /* eslint-disable quotes*/
25
24
  TestEnumTemplate = {
26
25
  typeid: "autodesk.core:UnitsEnum-1.0.0",
27
26
  inherits: "Enum",
@@ -1 +1 @@
1
- {"version":3,"file":"enumProperty.spec.js","sourceRoot":"","sources":["../../../src/test/properties/enumProperty.spec.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,yCAAyC;AACzC;;;GAGG;AAEH,IAAI,eAAe,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,qBAAqB,EAChF,YAAY,EAAE,SAAS,EAAE,8BAA8B,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAE9E,QAAQ,CAAC,mBAAmB,EAAE;IAC1B;;OAEG;IACH,MAAM,CAAC;QACH,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC;QACnD,YAAY,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC;QAC7C,SAAS,GAAG,OAAO,CAAC,wCAAwC,CAAC,CAAC,SAAS,CAAA;QACvE,GAAG,GAAG,OAAO,CAAC,qCAAqC,CAAC,CAAC,SAAS,CAAC,GAAG,CAAA;QAClE,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAC;QACtB,QAAQ,GAAG,CAAC,CAAC,SAAS,CAAC;QAGvB,4DAA4D;QAC5D,yDAAyD;QACzD,0BAA0B;QAC1B,gBAAgB,GAAG;YACf,MAAM,EAAE,+BAA+B;YACvC,QAAQ,EAAE,MAAM;YAChB,UAAU,EAAE,EAAE,WAAW,EAAE,kBAAkB,EAAE;YAC/C,UAAU,EAAE;gBACR,EAAE,E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,CAAC,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACxD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint-disable no-unused-expressions*/\n/**\n * @fileoverview In this file, we will test the functions of a EnumProperty object\n * described in /src/properties/enumProperty.js\n */\n\nvar PropertyFactory, TestEnumTemplate, TestInlineEnumTemplate, TestEnumArrayTemplate,\n BaseProperty, ChangeSet, TestBaseContainingEnumTemplate, MSG, deepCopy, _;\n\ndescribe('Test EnumProperty', function () {\n /**\n * Get all the objects we need in this test here.\n */\n before(function () {\n PropertyFactory = require('../..').PropertyFactory;\n BaseProperty = require('../..').BaseProperty;\n ChangeSet = require('@fluid-experimental/property-changeset').ChangeSet\n MSG = require('@fluid-experimental/property-common').constants.MSG\n _ = require('lodash');\n deepCopy = _.cloneDeep;\n\n\n // the following templates are copies from the specification\n // disableling the single quote rule to keep exact copies\n /* eslint-disable quotes*/\n TestEnumTemplate = {\n typeid: \"autodesk.core:UnitsEnum-1.0.0\",\n inherits: \"Enum\",\n annotation: { description: \"The metric units\" },\n properties: [\n { id: \"m\", value: 1, annotation: { description: \"meter\" } },\n { id: \"cm\", value: 2, annotation: { description: \"centimeter\" } },\n { id: \"mm\", value: 3, annotation: { description: \"millimeter\" } }\n ]\n };\n PropertyFactory._reregister(TestEnumTemplate);\n\n // Enums can also be defined in line in a template\n TestInlineEnumTemplate = {\n typeid: \"Adsk.Core:UI.Border-1.0.0\",\n properties: [\n {\n id: \"lineType\",\n typeid: \"Enum\",\n properties: [\n { id: \"solid\", value: 100, annotation: { description: \"solid line\" } },\n { id: \"dashed\", value: 200, annotation: { description: \"dashed line\" } },\n { id: \"dotted\", value: 300, annotation: { description: \"dotted line\" } }\n ]\n },\n {\n id: \"style\",\n properties: [\n {\n id: \"thickness\",\n typeid: \"Uint32\",\n annotation: {\n description: \"border thickness in Pixels\",\n unit: \"Adsk.Core:Units.Imaging-1.0.0\"\n }\n },\n {\n id: \"secondLevelInlineEnum\",\n typeid: \"Enum\",\n properties: [\n { id: \"A\", value: 0, annotation: { description: \"The Letter A.\" } },\n { id: \"B\", value: 76596785, annotation: { description: \"The Letter B.\" } },\n { id: \"C\", value: -199999, annotation: { description: \"The Letter C.\" } }\n ]\n }\n ]\n }\n ]\n };\n\n PropertyFactory._reregister(TestInlineEnumTemplate);\n\n TestBaseContainingEnumTemplate = {\n typeid: 'autodesk.core:CustomWithEnumID-1.0.0',\n properties: [{\n id: 'MyEnum', typeid: 'autodesk.core:UnitsEnum-1.0.0'\n }\n ]\n };\n PropertyFactory._reregister(TestBaseContainingEnumTemplate);\n\n TestEnumArrayTemplate = {\n typeid: 'autodesk.core:EnumArrayTestID-1.0.0',\n properties: [{\n id: 'MyEnumArray', typeid: 'autodesk.core:UnitsEnum-1.0.0', context: 'array'\n }]\n };\n PropertyFactory._reregister(TestEnumArrayTemplate);\n });\n\n it('@bugFix should not modify the registered template', function () {\n let enumTemplate = {\n typeid: \"autodesk.core:testEnum-1.0.0\",\n annotation: { description: \"The metric units\" },\n properties: [{\n typeid: \"Enum\",\n id: 'preset',\n properties: [\n { id: \"m\", value: 1, annotation: { description: \"meter\" } },\n { id: \"cm\", value: 2, annotation: { description: \"centimeter\" } },\n { id: \"mm\", value: 3, annotation: { description: \"millimeter\" } }\n ]\n }\n ]\n };\n let copyOfTemplate = deepCopy(enumTemplate);\n PropertyFactory._reregister(enumTemplate);\n expect(copyOfTemplate).to.deep.equal(enumTemplate);\n expect(PropertyFactory.getTemplate(copyOfTemplate.typeid).serialize()).to.deep.equal(copyOfTemplate);\n });\n\n it('should correctly set/get the Enum values', function () {\n\n var enumProp = PropertyFactory.create('autodesk.core:UnitsEnum-1.0.0');\n\n enumProp.setEnumByString('cm');\n expect(enumProp.getValue()).to.equal(2);\n expect(enumProp.getEnumString()).to.equal('cm');\n\n enumProp.setEnumByString('mm');\n expect(enumProp.getValue()).to.equal(3);\n expect(enumProp.getEnumString()).to.equal('mm');\n\n var enumInlineProp = PropertyFactory.create('Adsk.Core:UI.Border-1.0.0');\n var inlinedEnum = enumInlineProp._properties.lineType;\n inlinedEnum.setEnumByString(\"solid\");\n expect(inlinedEnum.getValue()).to.equal(100);\n expect(inlinedEnum.getEnumString()).to.equal('solid');\n\n var secondLevelInlineProperty = enumInlineProp._properties.style.secondLevelInlineEnum;\n secondLevelInlineProperty.setEnumByString('B');\n expect(secondLevelInlineProperty.getValue()).to.equal(76596785);\n expect(secondLevelInlineProperty.getEnumString()).to.equal('B');\n\n enumInlineProp._properties.style.thickness.value = 5;\n\n var firstOne = enumInlineProp.serialize();\n var anotherEnumInlineProp = PropertyFactory.create('Adsk.Core:UI.Border-1.0.0');\n anotherEnumInlineProp.deserialize(firstOne);\n var anotherOne = anotherEnumInlineProp.serialize();\n expect(firstOne).to.deep.equal(anotherOne);\n });\n\n it('should throw on setting invalid Enum strings', function () {\n var enumProp = PropertyFactory.create('autodesk.core:UnitsEnum-1.0.0');\n expect(function () {\n enumProp.setEnumByString('BadGuy');\n }).to.throw();\n });\n\n it('should throw on setting invalid Enum values', function () {\n var enumProp = PropertyFactory.create('autodesk.core:UnitsEnum-1.0.0');\n expect(function () {\n enumProp.setValue(23);\n }).to.throw();\n });\n\n it('should correctly squash Enums', function () {\n var enum1 = PropertyFactory.create('autodesk.core:CustomWithEnumID-1.0.0');\n enum1._properties.MyEnum.value = 1;\n var squashedChangeset = new ChangeSet(enum1.serialize({ 'dirtyOnly': false }));\n\n enum1._properties.MyEnum.value = 2;\n var changes = enum1.serialize({ 'dirtyOnly': true });\n squashedChangeset.applyChangeSet(changes);\n\n var serializedChangeset = enum1.serialize({ 'dirtyOnly': false });\n expect(serializedChangeset).to.deep.equal(squashedChangeset.getSerializedChangeSet());\n });\n\n it('should have a default value that is the lowest valid value', function () {\n var enumProp = PropertyFactory.create('autodesk.core:CustomWithEnumID-1.0.0');\n expect(enumProp.get('MyEnum').value).to.equal(1);\n });\n\n it('should have a default value of 0 if 0 is a valid value', function () {\n var enumProp = PropertyFactory.create('Adsk.Core:UI.Border-1.0.0');\n expect(enumProp.get('style').get('secondLevelInlineEnum').value).to.equal(0);\n });\n\n it('should be possible to dynamically add an Enum to a NodeProperty', function () {\n var enumProp = PropertyFactory.create('autodesk.core:UnitsEnum-1.0.0');\n var myNode = PropertyFactory.create('NodeProperty');\n myNode.insert('myEnum', enumProp);\n myNode._properties.myEnum.value = 2;\n var myNodeCopy = PropertyFactory.create('NodeProperty');\n myNodeCopy.deserialize(myNode.serialize({ 'dirtyOnly': false }));\n // test if the dictionary of the copy is initialized correctly\n expect(myNodeCopy._properties.myEnum.getEnumString()).to.equal('cm');\n\n // test the consitency of the copy\n expect(myNode.serialize({ 'dirtyOnly': false })).to.deep.equal(myNodeCopy.serialize({ 'dirtyOnly': false }));\n });\n\n it('should correctly rebase Properties containing Enum values and correctly show conflicts', function () {\n var baseProperty1 = PropertyFactory.create('autodesk.core:CustomWithEnumID-1.0.0');\n\n // Create two copies of this state\n var baseProperty2 = PropertyFactory.create('autodesk.core:CustomWithEnumID-1.0.0');\n baseProperty2.deserialize(baseProperty1.serialize({ 'dirtyOnly': false }));\n var baseProperty3 = PropertyFactory.create('autodesk.core:CustomWithEnumID-1.0.0');\n baseProperty3.deserialize(baseProperty1.serialize({ 'dirtyOnly': false }));\n\n // Make sure the states are clear\n baseProperty1.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n baseProperty2.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n\n // Apply the operations to the two properties in parallel\n baseProperty1._properties.MyEnum.value = 2;\n baseProperty2._properties.MyEnum.value = 3;\n\n // Get the ChangeSets\n var changeSet1 = new ChangeSet(baseProperty1.serialize({ 'dirtyOnly': true }));\n var changeSet2 = baseProperty2.serialize({ 'dirtyOnly': true });\n\n // Perform the actual rebase\n var conflicts = [];\n changeSet1._rebaseChangeSet(changeSet2, conflicts);\n\n // check result\n expect(changeSet1.getSerializedChangeSet()).to.deep.equal({\n 'enum<autodesk.core:UnitsEnum-1.0.0>': {\n MyEnum: 2\n }\n });\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);\n expect(conflicts[0].path).to.be.equal('');\n expect(conflicts[0].conflictingChange['enum<autodesk.core:UnitsEnum-1.0.0>'].MyEnum).to.be.equal(2);\n });\n\n it('specialized EnumArrayProperty should work correctly', function () {\n var enum1 = PropertyFactory.create('autodesk.core:EnumArrayTestID-1.0.0');\n var enumArray = enum1._properties.MyEnumArray;\n enumArray.insertRange(0, [1, 'cm', 'mm', 3]);\n enumArray.setRange(2, ['m']);\n enumArray.remove(0, 1);\n expect(enumArray.getEnumString(2)).to.equal('mm');\n expect(enumArray.serialize()).to.deep.equal(\n {\n 'insert': [\n [0, [2, 1, 3]]\n ]\n }\n );\n });\n\n it('.setRange should throw an error when in_offset is not an integer', function () {\n var enum1 = PropertyFactory.create('autodesk.core:EnumArrayTestID-1.0.0');\n var enumArray = enum1._properties.MyEnumArray;\n enumArray.insertRange(0, [1, 'cm', 'mm']);\n expect(() => { enumArray.setRange('test', ['m']); })\n .to.throw(MSG.NOT_NUMBER);\n });\n\n it('.setRange should throw an error when in_array is not an array', function () {\n var enum1 = PropertyFactory.create('autodesk.core:EnumArrayTestID-1.0.0');\n var enumArray = enum1._properties.MyEnumArray;\n enumArray.insertRange(0, [1, 'cm', 'mm']);\n expect(() => { enumArray.setRange(2, 'm'); })\n .to.throw(MSG.IN_ARRAY_NOT_ARRAY + 'EnumArrayProperty.setRange');\n });\n\n it('.set should throw an error when in_offset is not an integer', function () {\n var enum1 = PropertyFactory.create('autodesk.core:EnumArrayTestID-1.0.0');\n var enumArray = enum1._properties.MyEnumArray;\n enumArray.insertRange(0, [1, 'cm', 'mm']);\n expect(() => { enumArray.set('test', 'm'); })\n .to.throw(MSG.NOT_NUMBER);\n });\n\n it('.set should throw an error when in_value is an array', function () {\n var enum1 = PropertyFactory.create('autodesk.core:EnumArrayTestID-1.0.0');\n var enumArray = enum1._properties.MyEnumArray;\n enumArray.insertRange(0, [1, 'cm', 'mm']);\n expect(() => { enumArray.set(2, ['m']); }).to.throw(MSG.VALUE_STRING_OR_NUMBER);\n });\n\n it('isPrimitiveType should evaluate to true', function () {\n var enum1 = PropertyFactory.create(TestEnumTemplate.typeid);\n expect(enum1.isPrimitiveType()).to.equal(true);\n });\n\n it('.getValidEnumList should return expected enum list', function () {\n var enumProp = PropertyFactory.create('autodesk.core:UnitsEnum-1.0.0');\n var enumList = enumProp.getValidEnumList();\n expect(enumList).to.have.nested.property('m.value', 1);\n expect(enumList).to.have.nested.property('cm.value', 2);\n expect(enumList).to.have.nested.property('mm.value', 3);\n });\n});\n"]}
1
+ {"version":3,"file":"enumProperty.spec.js","sourceRoot":"","sources":["../../../src/test/properties/enumProperty.spec.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,yCAAyC;AACzC;;;GAGG;AAEH,IAAI,eAAe,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,qBAAqB,EAChF,YAAY,EAAE,SAAS,EAAE,8BAA8B,EAAE,GAAG,EAAE,QAAQ,EAAE,CAAC,CAAC;AAE9E,QAAQ,CAAC,mBAAmB,EAAE;IAC1B;;OAEG;IACH,MAAM,CAAC;QACH,eAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC,eAAe,CAAC;QACnD,YAAY,GAAG,OAAO,CAAC,OAAO,CAA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AAe,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC;QAC5D,MAAM,CAAC,KAAK,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACnD,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,oDAAoD,EAAE;QACrD,IAAI,QAAQ,GAAG,eAAe,CAAC,MAAM,CAAC,+BAA+B,CAAC,CAAC;QACvE,IAAI,QAAQ,GAAG,QAAQ,CAAC,gBAAgB,EAAE,CAAC;QAC3C,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;QACvD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;QACxD,MAAM,CAAC,QAAQ,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC;IAC5D,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint-disable no-unused-expressions*/\n/**\n * @fileoverview In this file, we will test the functions of a EnumProperty object\n * described in /src/properties/enumProperty.js\n */\n\nvar PropertyFactory, TestEnumTemplate, TestInlineEnumTemplate, TestEnumArrayTemplate,\n BaseProperty, ChangeSet, TestBaseContainingEnumTemplate, MSG, deepCopy, _;\n\ndescribe('Test EnumProperty', function () {\n /**\n * Get all the objects we need in this test here.\n */\n before(function () {\n PropertyFactory = require('../..').PropertyFactory;\n BaseProperty = require('../..').BaseProperty;\n ChangeSet = require('@fluid-experimental/property-changeset').ChangeSet\n MSG = require('@fluid-experimental/property-common').constants.MSG\n _ = require('lodash');\n deepCopy = _.cloneDeep;\n\n\n // the following templates are copies from the specification\n // disableling the single quote rule to keep exact copies\n TestEnumTemplate = {\n typeid: \"autodesk.core:UnitsEnum-1.0.0\",\n inherits: \"Enum\",\n annotation: { description: \"The metric units\" },\n properties: [\n { id: \"m\", value: 1, annotation: { description: \"meter\" } },\n { id: \"cm\", value: 2, annotation: { description: \"centimeter\" } },\n { id: \"mm\", value: 3, annotation: { description: \"millimeter\" } }\n ]\n };\n PropertyFactory._reregister(TestEnumTemplate);\n\n // Enums can also be defined in line in a template\n TestInlineEnumTemplate = {\n typeid: \"Adsk.Core:UI.Border-1.0.0\",\n properties: [\n {\n id: \"lineType\",\n typeid: \"Enum\",\n properties: [\n { id: \"solid\", value: 100, annotation: { description: \"solid line\" } },\n { id: \"dashed\", value: 200, annotation: { description: \"dashed line\" } },\n { id: \"dotted\", value: 300, annotation: { description: \"dotted line\" } }\n ]\n },\n {\n id: \"style\",\n properties: [\n {\n id: \"thickness\",\n typeid: \"Uint32\",\n annotation: {\n description: \"border thickness in Pixels\",\n unit: \"Adsk.Core:Units.Imaging-1.0.0\"\n }\n },\n {\n id: \"secondLevelInlineEnum\",\n typeid: \"Enum\",\n properties: [\n { id: \"A\", value: 0, annotation: { description: \"The Letter A.\" } },\n { id: \"B\", value: 76596785, annotation: { description: \"The Letter B.\" } },\n { id: \"C\", value: -199999, annotation: { description: \"The Letter C.\" } }\n ]\n }\n ]\n }\n ]\n };\n\n PropertyFactory._reregister(TestInlineEnumTemplate);\n\n TestBaseContainingEnumTemplate = {\n typeid: 'autodesk.core:CustomWithEnumID-1.0.0',\n properties: [{\n id: 'MyEnum', typeid: 'autodesk.core:UnitsEnum-1.0.0'\n }\n ]\n };\n PropertyFactory._reregister(TestBaseContainingEnumTemplate);\n\n TestEnumArrayTemplate = {\n typeid: 'autodesk.core:EnumArrayTestID-1.0.0',\n properties: [{\n id: 'MyEnumArray', typeid: 'autodesk.core:UnitsEnum-1.0.0', context: 'array'\n }]\n };\n PropertyFactory._reregister(TestEnumArrayTemplate);\n });\n\n it('@bugFix should not modify the registered template', function () {\n let enumTemplate = {\n typeid: \"autodesk.core:testEnum-1.0.0\",\n annotation: { description: \"The metric units\" },\n properties: [{\n typeid: \"Enum\",\n id: 'preset',\n properties: [\n { id: \"m\", value: 1, annotation: { description: \"meter\" } },\n { id: \"cm\", value: 2, annotation: { description: \"centimeter\" } },\n { id: \"mm\", value: 3, annotation: { description: \"millimeter\" } }\n ]\n }\n ]\n };\n let copyOfTemplate = deepCopy(enumTemplate);\n PropertyFactory._reregister(enumTemplate);\n expect(copyOfTemplate).to.deep.equal(enumTemplate);\n expect(PropertyFactory.getTemplate(copyOfTemplate.typeid).serialize()).to.deep.equal(copyOfTemplate);\n });\n\n it('should correctly set/get the Enum values', function () {\n\n var enumProp = PropertyFactory.create('autodesk.core:UnitsEnum-1.0.0');\n\n enumProp.setEnumByString('cm');\n expect(enumProp.getValue()).to.equal(2);\n expect(enumProp.getEnumString()).to.equal('cm');\n\n enumProp.setEnumByString('mm');\n expect(enumProp.getValue()).to.equal(3);\n expect(enumProp.getEnumString()).to.equal('mm');\n\n var enumInlineProp = PropertyFactory.create('Adsk.Core:UI.Border-1.0.0');\n var inlinedEnum = enumInlineProp._properties.lineType;\n inlinedEnum.setEnumByString(\"solid\");\n expect(inlinedEnum.getValue()).to.equal(100);\n expect(inlinedEnum.getEnumString()).to.equal('solid');\n\n var secondLevelInlineProperty = enumInlineProp._properties.style.secondLevelInlineEnum;\n secondLevelInlineProperty.setEnumByString('B');\n expect(secondLevelInlineProperty.getValue()).to.equal(76596785);\n expect(secondLevelInlineProperty.getEnumString()).to.equal('B');\n\n enumInlineProp._properties.style.thickness.value = 5;\n\n var firstOne = enumInlineProp.serialize();\n var anotherEnumInlineProp = PropertyFactory.create('Adsk.Core:UI.Border-1.0.0');\n anotherEnumInlineProp.deserialize(firstOne);\n var anotherOne = anotherEnumInlineProp.serialize();\n expect(firstOne).to.deep.equal(anotherOne);\n });\n\n it('should throw on setting invalid Enum strings', function () {\n var enumProp = PropertyFactory.create('autodesk.core:UnitsEnum-1.0.0');\n expect(function () {\n enumProp.setEnumByString('BadGuy');\n }).to.throw();\n });\n\n it('should throw on setting invalid Enum values', function () {\n var enumProp = PropertyFactory.create('autodesk.core:UnitsEnum-1.0.0');\n expect(function () {\n enumProp.setValue(23);\n }).to.throw();\n });\n\n it('should correctly squash Enums', function () {\n var enum1 = PropertyFactory.create('autodesk.core:CustomWithEnumID-1.0.0');\n enum1._properties.MyEnum.value = 1;\n var squashedChangeset = new ChangeSet(enum1.serialize({ 'dirtyOnly': false }));\n\n enum1._properties.MyEnum.value = 2;\n var changes = enum1.serialize({ 'dirtyOnly': true });\n squashedChangeset.applyChangeSet(changes);\n\n var serializedChangeset = enum1.serialize({ 'dirtyOnly': false });\n expect(serializedChangeset).to.deep.equal(squashedChangeset.getSerializedChangeSet());\n });\n\n it('should have a default value that is the lowest valid value', function () {\n var enumProp = PropertyFactory.create('autodesk.core:CustomWithEnumID-1.0.0');\n expect(enumProp.get('MyEnum').value).to.equal(1);\n });\n\n it('should have a default value of 0 if 0 is a valid value', function () {\n var enumProp = PropertyFactory.create('Adsk.Core:UI.Border-1.0.0');\n expect(enumProp.get('style').get('secondLevelInlineEnum').value).to.equal(0);\n });\n\n it('should be possible to dynamically add an Enum to a NodeProperty', function () {\n var enumProp = PropertyFactory.create('autodesk.core:UnitsEnum-1.0.0');\n var myNode = PropertyFactory.create('NodeProperty');\n myNode.insert('myEnum', enumProp);\n myNode._properties.myEnum.value = 2;\n var myNodeCopy = PropertyFactory.create('NodeProperty');\n myNodeCopy.deserialize(myNode.serialize({ 'dirtyOnly': false }));\n // test if the dictionary of the copy is initialized correctly\n expect(myNodeCopy._properties.myEnum.getEnumString()).to.equal('cm');\n\n // test the consitency of the copy\n expect(myNode.serialize({ 'dirtyOnly': false })).to.deep.equal(myNodeCopy.serialize({ 'dirtyOnly': false }));\n });\n\n it('should correctly rebase Properties containing Enum values and correctly show conflicts', function () {\n var baseProperty1 = PropertyFactory.create('autodesk.core:CustomWithEnumID-1.0.0');\n\n // Create two copies of this state\n var baseProperty2 = PropertyFactory.create('autodesk.core:CustomWithEnumID-1.0.0');\n baseProperty2.deserialize(baseProperty1.serialize({ 'dirtyOnly': false }));\n var baseProperty3 = PropertyFactory.create('autodesk.core:CustomWithEnumID-1.0.0');\n baseProperty3.deserialize(baseProperty1.serialize({ 'dirtyOnly': false }));\n\n // Make sure the states are clear\n baseProperty1.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n baseProperty2.cleanDirty(BaseProperty.MODIFIED_STATE_FLAGS.DIRTY |\n BaseProperty.MODIFIED_STATE_FLAGS.PENDING_CHANGE);\n\n // Apply the operations to the two properties in parallel\n baseProperty1._properties.MyEnum.value = 2;\n baseProperty2._properties.MyEnum.value = 3;\n\n // Get the ChangeSets\n var changeSet1 = new ChangeSet(baseProperty1.serialize({ 'dirtyOnly': true }));\n var changeSet2 = baseProperty2.serialize({ 'dirtyOnly': true });\n\n // Perform the actual rebase\n var conflicts = [];\n changeSet1._rebaseChangeSet(changeSet2, conflicts);\n\n // check result\n expect(changeSet1.getSerializedChangeSet()).to.deep.equal({\n 'enum<autodesk.core:UnitsEnum-1.0.0>': {\n MyEnum: 2\n }\n });\n expect(conflicts).to.have.length(1);\n expect(conflicts[0].type).to.be.equal(ChangeSet.ConflictType.COLLIDING_SET);\n expect(conflicts[0].path).to.be.equal('');\n expect(conflicts[0].conflictingChange['enum<autodesk.core:UnitsEnum-1.0.0>'].MyEnum).to.be.equal(2);\n });\n\n it('specialized EnumArrayProperty should work correctly', function () {\n var enum1 = PropertyFactory.create('autodesk.core:EnumArrayTestID-1.0.0');\n var enumArray = enum1._properties.MyEnumArray;\n enumArray.insertRange(0, [1, 'cm', 'mm', 3]);\n enumArray.setRange(2, ['m']);\n enumArray.remove(0, 1);\n expect(enumArray.getEnumString(2)).to.equal('mm');\n expect(enumArray.serialize()).to.deep.equal(\n {\n 'insert': [\n [0, [2, 1, 3]]\n ]\n }\n );\n });\n\n it('.setRange should throw an error when in_offset is not an integer', function () {\n var enum1 = PropertyFactory.create('autodesk.core:EnumArrayTestID-1.0.0');\n var enumArray = enum1._properties.MyEnumArray;\n enumArray.insertRange(0, [1, 'cm', 'mm']);\n expect(() => { enumArray.setRange('test', ['m']); })\n .to.throw(MSG.NOT_NUMBER);\n });\n\n it('.setRange should throw an error when in_array is not an array', function () {\n var enum1 = PropertyFactory.create('autodesk.core:EnumArrayTestID-1.0.0');\n var enumArray = enum1._properties.MyEnumArray;\n enumArray.insertRange(0, [1, 'cm', 'mm']);\n expect(() => { enumArray.setRange(2, 'm'); })\n .to.throw(MSG.IN_ARRAY_NOT_ARRAY + 'EnumArrayProperty.setRange');\n });\n\n it('.set should throw an error when in_offset is not an integer', function () {\n var enum1 = PropertyFactory.create('autodesk.core:EnumArrayTestID-1.0.0');\n var enumArray = enum1._properties.MyEnumArray;\n enumArray.insertRange(0, [1, 'cm', 'mm']);\n expect(() => { enumArray.set('test', 'm'); })\n .to.throw(MSG.NOT_NUMBER);\n });\n\n it('.set should throw an error when in_value is an array', function () {\n var enum1 = PropertyFactory.create('autodesk.core:EnumArrayTestID-1.0.0');\n var enumArray = enum1._properties.MyEnumArray;\n enumArray.insertRange(0, [1, 'cm', 'mm']);\n expect(() => { enumArray.set(2, ['m']); }).to.throw(MSG.VALUE_STRING_OR_NUMBER);\n });\n\n it('isPrimitiveType should evaluate to true', function () {\n var enum1 = PropertyFactory.create(TestEnumTemplate.typeid);\n expect(enum1.isPrimitiveType()).to.equal(true);\n });\n\n it('.getValidEnumList should return expected enum list', function () {\n var enumProp = PropertyFactory.create('autodesk.core:UnitsEnum-1.0.0');\n var enumList = enumProp.getValidEnumList();\n expect(enumList).to.have.nested.property('m.value', 1);\n expect(enumList).to.have.nested.property('cm.value', 2);\n expect(enumList).to.have.nested.property('mm.value', 3);\n });\n});\n"]}
@@ -17,7 +17,6 @@ if (typeof process === 'object' && Object.prototype.toString.call(process) === '
17
17
  isBrowser = false;
18
18
  }
19
19
  else {
20
- /* eslint-disable */
21
20
  // We are in the browser. Set up variables like above using served js files.
22
21
  expect = chai.expect;
23
22
  assert = chai.assert;
@@ -1 +1 @@
1
- {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/test/setup.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,2CAA2C;AAC3C,GAAG,GAAG,KAAK,CAAC;AAEZ,iEAAiE;AACjE,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,kBAAkB,EAAE;IAC/F,mCAAmC;IACnC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACvB,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IACrB,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IACrB,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACvB,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IACrB,SAAS,GAAG,KAAK,CAAC;CACrB;KAAM;IACH,oBAAoB;IACpB,4EAA4E;IAC5E,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IACrB,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IACrB,SAAS,GAAG,IAAI,CAAC;CACpB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint no-unused-vars: 0, no-undef: 0 */\nsdk = false;\n\n// Export modules to global scope as necessary (only for testing)\nif (typeof process === 'object' && Object.prototype.toString.call(process) === '[object process]') {\n // We are in node. Require modules.\n chai = require('chai');\n expect = chai.expect;\n assert = chai.assert;\n nock = require('nock');\n sinon = require('sinon');\n should = chai.should();\n _ = require('lodash')\n isBrowser = false;\n} else {\n /* eslint-disable */\n // We are in the browser. Set up variables like above using served js files.\n expect = chai.expect;\n assert = chai.assert;\n isBrowser = true;\n}\n"]}
1
+ {"version":3,"file":"setup.js","sourceRoot":"","sources":["../../src/test/setup.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH,2CAA2C;AAC3C,GAAG,GAAG,KAAK,CAAC;AAEZ,iEAAiE;AACjE,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,kBAAkB,EAAE;IAC/F,mCAAmC;IACnC,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACvB,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IACrB,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IACrB,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACvB,KAAK,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,GAAG,IAAI,CAAC,MAAM,EAAE,CAAC;IACvB,CAAC,GAAG,OAAO,CAAC,QAAQ,CAAC,CAAA;IACrB,SAAS,GAAG,KAAK,CAAC;CACrB;KAAM;IACH,4EAA4E;IAC5E,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IACrB,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;IACrB,SAAS,GAAG,IAAI,CAAC;CACpB","sourcesContent":["/*!\n * Copyright (c) Microsoft Corporation and contributors. All rights reserved.\n * Licensed under the MIT License.\n */\n/* eslint no-unused-vars: 0, no-undef: 0 */\nsdk = false;\n\n// Export modules to global scope as necessary (only for testing)\nif (typeof process === 'object' && Object.prototype.toString.call(process) === '[object process]') {\n // We are in node. Require modules.\n chai = require('chai');\n expect = chai.expect;\n assert = chai.assert;\n nock = require('nock');\n sinon = require('sinon');\n should = chai.should();\n _ = require('lodash')\n isBrowser = false;\n} else {\n // We are in the browser. Set up variables like above using served js files.\n expect = chai.expect;\n assert = chai.assert;\n isBrowser = true;\n}\n"]}
@@ -216,11 +216,6 @@
216
216
  "signature": "2e30ee8b7d33552430d8b4089f9a0948f26772cb55c88a283c5ff05c7e7307c8",
217
217
  "affectsGlobalScope": false
218
218
  },
219
- "../../../../../../node_modules/@types/async/index.d.ts": {
220
- "version": "21d0d028eee8b7e0f7ff96cb44e9e7f0a0fe719191c49f43ac7c9252216c28d6",
221
- "signature": "21d0d028eee8b7e0f7ff96cb44e9e7f0a0fe719191c49f43ac7c9252216c28d6",
222
- "affectsGlobalScope": false
223
- },
224
219
  "../../../property-changeset/dist/utils.d.ts": {
225
220
  "version": "4049ccbe597d0f2713d03095120123d50f46a962e8d9f4b1fed3561ff6349c16",
226
221
  "signature": "4049ccbe597d0f2713d03095120123d50f46a962e8d9f4b1fed3561ff6349c16",
@@ -777,7 +772,7 @@
777
772
  "affectsGlobalScope": false
778
773
  },
779
774
  "../../src/test/setup.js": {
780
- "version": "35c491575294043aa8c264054274e0935429466fca89e6f4ec8adcddcf33224b",
775
+ "version": "0488bf08d1c569780715d1be3163e9162250f1e5fc7222ea2db29e6eba78da5d",
781
776
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
782
777
  "affectsGlobalScope": true
783
778
  },
@@ -812,7 +807,7 @@
812
807
  "affectsGlobalScope": true
813
808
  },
814
809
  "../../src/test/properties/enumProperty.spec.js": {
815
- "version": "ff8bc2fb974dfb21b932757a26fee000056f9380c848d0721154e569948c458b",
810
+ "version": "2f01e72e0295d8178239359c15dcd064ea89a6e7015e7a15700b8efc95848346",
816
811
  "signature": "8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881",
817
812
  "affectsGlobalScope": true
818
813
  },
@@ -969,7 +964,6 @@
969
964
  "../../../property-changeset/dist/validationResultBuilder.d.ts"
970
965
  ],
971
966
  "../../../property-changeset/dist/utils.d.ts": [
972
- "../../../../../../node_modules/@types/async/index.d.ts",
973
967
  "../../../property-changeset/dist/changeset.d.ts",
974
968
  "../../../property-changeset/dist/helpers/typeidHelper.d.ts",
975
969
  "../../../property-changeset/dist/pathHelper.d.ts"
@@ -1677,7 +1671,6 @@
1677
1671
  "../../../property-changeset/dist/validationResultBuilder.d.ts"
1678
1672
  ],
1679
1673
  "../../../property-changeset/dist/utils.d.ts": [
1680
- "../../../../../../node_modules/@types/async/index.d.ts",
1681
1674
  "../../../property-changeset/dist/changeset.d.ts",
1682
1675
  "../../../property-changeset/dist/helpers/typeidHelper.d.ts",
1683
1676
  "../../../property-changeset/dist/pathHelper.d.ts"
@@ -2298,7 +2291,6 @@
2298
2291
  "../../src/test/validation/goodColorPalette.js",
2299
2292
  "../../src/test/validation/goodPointId.js",
2300
2293
  "../../src/test/validation/reversibleChangeSetTestData.js",
2301
- "../../../../../../node_modules/@types/async/index.d.ts",
2302
2294
  "../../../../../../node_modules/@types/events/index.d.ts",
2303
2295
  "../../../../../../node_modules/@types/lodash/common/array.d.ts",
2304
2296
  "../../../../../../node_modules/@types/lodash/common/collection.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-experimental/property-properties",
3
- "version": "0.57.1",
3
+ "version": "0.58.0-55561",
4
4
  "description": "definitions of properties",
5
5
  "homepage": "https://fluidframework.com",
6
6
  "repository": "https://github.com/microsoft/FluidFramework",
@@ -15,7 +15,7 @@
15
15
  "src/index.d.ts"
16
16
  ],
17
17
  "scripts": {
18
- "build": "npm run build:compile",
18
+ "build": "concurrently npm:build:compile npm:lint",
19
19
  "build:commonjs": "npm run tsc && npm run build:test",
20
20
  "build:compile": "concurrently npm:build:commonjs npm:build:esnext",
21
21
  "build:esnext": "tsc --project ./tsconfig.esnext.json",
@@ -26,6 +26,7 @@
26
26
  "coverage": "npx nyc --silent --cwd .. --nycrc-path `pwd`/.nycrc npm run test && npx nyc --no-clean --silent --cwd .. --nycrc-path `pwd`/.nycrc npm run test:changeset && npx nyc --no-clean --cwd .. --nycrc-path `pwd`/.nycrc npm run test:common",
27
27
  "eslint": "eslint --format stylish src",
28
28
  "eslint:fix": "eslint --format stylish src --fix --fix-type problem,suggestion,layout",
29
+ "lint": "npm run eslint",
29
30
  "lint:fix": "npm run eslint:fix",
30
31
  "test": "npm run test:mocha",
31
32
  "test:coverage": "nyc npm test -- --reporter xunit --reporter-option output=nyc/junit-report.xml",
@@ -56,8 +57,8 @@
56
57
  "temp-directory": "nyc/.nyc_output"
57
58
  },
58
59
  "dependencies": {
59
- "@fluid-experimental/property-changeset": "^0.57.1",
60
- "@fluid-experimental/property-common": "^0.57.1",
60
+ "@fluid-experimental/property-changeset": "0.58.0-55561",
61
+ "@fluid-experimental/property-common": "0.58.0-55561",
61
62
  "ajv": "7.1.1",
62
63
  "async": "^3.2.0",
63
64
  "lodash": "^4.17.21",
@@ -66,10 +67,17 @@
66
67
  },
67
68
  "devDependencies": {
68
69
  "@fluidframework/build-common": "^0.23.0",
69
- "@fluidframework/mocha-test-setup": "^0.57.1",
70
+ "@fluidframework/mocha-test-setup": "0.58.0-55561",
70
71
  "chai": "^4.2.0",
71
72
  "concurrently": "^6.2.0",
72
73
  "cross-env": "^7.0.2",
74
+ "eslint": "~8.6.0",
75
+ "eslint-plugin-editorconfig": "~3.2.0",
76
+ "eslint-plugin-eslint-comments": "~3.2.0",
77
+ "eslint-plugin-import": "~2.25.4",
78
+ "eslint-plugin-no-null": "~1.0.2",
79
+ "eslint-plugin-react": "~7.28.0",
80
+ "eslint-plugin-unicorn": "~40.0.0",
73
81
  "mocha": "^8.4.0",
74
82
  "nock": "^10.0.1",
75
83
  "nyc": "^15.0.0",