@itwin/core-backend 5.3.0-dev.9 → 5.3.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 (175) hide show
  1. package/CHANGELOG.md +52 -1
  2. package/lib/cjs/BriefcaseManager.d.ts.map +1 -1
  3. package/lib/cjs/BriefcaseManager.js +14 -0
  4. package/lib/cjs/BriefcaseManager.js.map +1 -1
  5. package/lib/cjs/CloudSqlite.d.ts +2 -0
  6. package/lib/cjs/CloudSqlite.d.ts.map +1 -1
  7. package/lib/cjs/CloudSqlite.js.map +1 -1
  8. package/lib/cjs/DisplayStyle.d.ts +2 -2
  9. package/lib/cjs/DisplayStyle.d.ts.map +1 -1
  10. package/lib/cjs/DisplayStyle.js +4 -4
  11. package/lib/cjs/DisplayStyle.js.map +1 -1
  12. package/lib/cjs/ECDb.js +1 -1
  13. package/lib/cjs/ECDb.js.map +1 -1
  14. package/lib/cjs/Element.d.ts +31 -3
  15. package/lib/cjs/Element.d.ts.map +1 -1
  16. package/lib/cjs/Element.js +55 -3
  17. package/lib/cjs/Element.js.map +1 -1
  18. package/lib/cjs/ElementAspect.d.ts +24 -1
  19. package/lib/cjs/ElementAspect.d.ts.map +1 -1
  20. package/lib/cjs/ElementAspect.js +102 -1
  21. package/lib/cjs/ElementAspect.js.map +1 -1
  22. package/lib/cjs/IModelDb.d.ts +26 -3
  23. package/lib/cjs/IModelDb.d.ts.map +1 -1
  24. package/lib/cjs/IModelDb.js +60 -5
  25. package/lib/cjs/IModelDb.js.map +1 -1
  26. package/lib/cjs/IModelElementCloneContext.d.ts +1 -1
  27. package/lib/cjs/IModelElementCloneContext.d.ts.map +1 -1
  28. package/lib/cjs/IModelElementCloneContext.js +2 -2
  29. package/lib/cjs/IModelElementCloneContext.js.map +1 -1
  30. package/lib/cjs/Material.d.ts +1 -1
  31. package/lib/cjs/Material.d.ts.map +1 -1
  32. package/lib/cjs/Material.js +2 -2
  33. package/lib/cjs/Material.js.map +1 -1
  34. package/lib/cjs/NavigationRelationship.d.ts +15 -0
  35. package/lib/cjs/NavigationRelationship.d.ts.map +1 -1
  36. package/lib/cjs/NavigationRelationship.js +22 -1
  37. package/lib/cjs/NavigationRelationship.js.map +1 -1
  38. package/lib/cjs/Relationship.d.ts +5 -0
  39. package/lib/cjs/Relationship.d.ts.map +1 -1
  40. package/lib/cjs/Relationship.js +7 -0
  41. package/lib/cjs/Relationship.js.map +1 -1
  42. package/lib/cjs/TxnManager.d.ts +8 -0
  43. package/lib/cjs/TxnManager.d.ts.map +1 -1
  44. package/lib/cjs/TxnManager.js +30 -2
  45. package/lib/cjs/TxnManager.js.map +1 -1
  46. package/lib/cjs/ViewDefinition.d.ts +1 -1
  47. package/lib/cjs/ViewDefinition.d.ts.map +1 -1
  48. package/lib/cjs/ViewDefinition.js +2 -2
  49. package/lib/cjs/ViewDefinition.js.map +1 -1
  50. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts +15 -1
  51. package/lib/cjs/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
  52. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js +36 -23
  53. package/lib/cjs/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  54. package/lib/cjs/annotations/LeaderGeometry.d.ts +13 -1
  55. package/lib/cjs/annotations/LeaderGeometry.d.ts.map +1 -1
  56. package/lib/cjs/annotations/LeaderGeometry.js +88 -10
  57. package/lib/cjs/annotations/LeaderGeometry.js.map +1 -1
  58. package/lib/cjs/annotations/TextAnnotationElement.d.ts +6 -5
  59. package/lib/cjs/annotations/TextAnnotationElement.d.ts.map +1 -1
  60. package/lib/cjs/annotations/TextAnnotationElement.js +33 -14
  61. package/lib/cjs/annotations/TextAnnotationElement.js.map +1 -1
  62. package/lib/cjs/annotations/TextBlockLayout.d.ts.map +1 -1
  63. package/lib/cjs/annotations/TextBlockLayout.js +2 -1
  64. package/lib/cjs/annotations/TextBlockLayout.js.map +1 -1
  65. package/lib/cjs/internal/annotations/fields.d.ts +3 -2
  66. package/lib/cjs/internal/annotations/fields.d.ts.map +1 -1
  67. package/lib/cjs/internal/annotations/fields.js +12 -5
  68. package/lib/cjs/internal/annotations/fields.js.map +1 -1
  69. package/lib/esm/BriefcaseManager.d.ts.map +1 -1
  70. package/lib/esm/BriefcaseManager.js +14 -0
  71. package/lib/esm/BriefcaseManager.js.map +1 -1
  72. package/lib/esm/CloudSqlite.d.ts +2 -0
  73. package/lib/esm/CloudSqlite.d.ts.map +1 -1
  74. package/lib/esm/CloudSqlite.js.map +1 -1
  75. package/lib/esm/DisplayStyle.d.ts +2 -2
  76. package/lib/esm/DisplayStyle.d.ts.map +1 -1
  77. package/lib/esm/DisplayStyle.js +4 -4
  78. package/lib/esm/DisplayStyle.js.map +1 -1
  79. package/lib/esm/ECDb.js +1 -1
  80. package/lib/esm/ECDb.js.map +1 -1
  81. package/lib/esm/Element.d.ts +31 -3
  82. package/lib/esm/Element.d.ts.map +1 -1
  83. package/lib/esm/Element.js +55 -4
  84. package/lib/esm/Element.js.map +1 -1
  85. package/lib/esm/ElementAspect.d.ts +24 -1
  86. package/lib/esm/ElementAspect.d.ts.map +1 -1
  87. package/lib/esm/ElementAspect.js +101 -1
  88. package/lib/esm/ElementAspect.js.map +1 -1
  89. package/lib/esm/IModelDb.d.ts +26 -3
  90. package/lib/esm/IModelDb.d.ts.map +1 -1
  91. package/lib/esm/IModelDb.js +60 -5
  92. package/lib/esm/IModelDb.js.map +1 -1
  93. package/lib/esm/IModelElementCloneContext.d.ts +1 -1
  94. package/lib/esm/IModelElementCloneContext.d.ts.map +1 -1
  95. package/lib/esm/IModelElementCloneContext.js +2 -2
  96. package/lib/esm/IModelElementCloneContext.js.map +1 -1
  97. package/lib/esm/Material.d.ts +1 -1
  98. package/lib/esm/Material.d.ts.map +1 -1
  99. package/lib/esm/Material.js +2 -2
  100. package/lib/esm/Material.js.map +1 -1
  101. package/lib/esm/NavigationRelationship.d.ts +15 -0
  102. package/lib/esm/NavigationRelationship.d.ts.map +1 -1
  103. package/lib/esm/NavigationRelationship.js +19 -0
  104. package/lib/esm/NavigationRelationship.js.map +1 -1
  105. package/lib/esm/Relationship.d.ts +5 -0
  106. package/lib/esm/Relationship.d.ts.map +1 -1
  107. package/lib/esm/Relationship.js +7 -0
  108. package/lib/esm/Relationship.js.map +1 -1
  109. package/lib/esm/TxnManager.d.ts +8 -0
  110. package/lib/esm/TxnManager.d.ts.map +1 -1
  111. package/lib/esm/TxnManager.js +30 -2
  112. package/lib/esm/TxnManager.js.map +1 -1
  113. package/lib/esm/ViewDefinition.d.ts +1 -1
  114. package/lib/esm/ViewDefinition.d.ts.map +1 -1
  115. package/lib/esm/ViewDefinition.js +2 -2
  116. package/lib/esm/ViewDefinition.js.map +1 -1
  117. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts +15 -1
  118. package/lib/esm/annotations/ElementDrivesTextAnnotation.d.ts.map +1 -1
  119. package/lib/esm/annotations/ElementDrivesTextAnnotation.js +37 -24
  120. package/lib/esm/annotations/ElementDrivesTextAnnotation.js.map +1 -1
  121. package/lib/esm/annotations/LeaderGeometry.d.ts +13 -1
  122. package/lib/esm/annotations/LeaderGeometry.d.ts.map +1 -1
  123. package/lib/esm/annotations/LeaderGeometry.js +89 -12
  124. package/lib/esm/annotations/LeaderGeometry.js.map +1 -1
  125. package/lib/esm/annotations/TextAnnotationElement.d.ts +6 -5
  126. package/lib/esm/annotations/TextAnnotationElement.d.ts.map +1 -1
  127. package/lib/esm/annotations/TextAnnotationElement.js +33 -14
  128. package/lib/esm/annotations/TextAnnotationElement.js.map +1 -1
  129. package/lib/esm/annotations/TextBlockLayout.d.ts.map +1 -1
  130. package/lib/esm/annotations/TextBlockLayout.js +2 -1
  131. package/lib/esm/annotations/TextBlockLayout.js.map +1 -1
  132. package/lib/esm/internal/annotations/fields.d.ts +3 -2
  133. package/lib/esm/internal/annotations/fields.d.ts.map +1 -1
  134. package/lib/esm/internal/annotations/fields.js +11 -5
  135. package/lib/esm/internal/annotations/fields.js.map +1 -1
  136. package/lib/esm/test/ElementDrivesElement.test.d.ts +93 -0
  137. package/lib/esm/test/ElementDrivesElement.test.d.ts.map +1 -0
  138. package/lib/esm/test/ElementDrivesElement.test.js +862 -0
  139. package/lib/esm/test/ElementDrivesElement.test.js.map +1 -0
  140. package/lib/esm/test/ElementLRUCache.test.js +13 -0
  141. package/lib/esm/test/ElementLRUCache.test.js.map +1 -1
  142. package/lib/esm/test/annotations/Fields.test.js +44 -0
  143. package/lib/esm/test/annotations/Fields.test.js.map +1 -1
  144. package/lib/esm/test/annotations/LeaderGeometry.test.js +47 -2
  145. package/lib/esm/test/annotations/LeaderGeometry.test.js.map +1 -1
  146. package/lib/esm/test/annotations/TextAnnotation.test.js +120 -31
  147. package/lib/esm/test/annotations/TextAnnotation.test.js.map +1 -1
  148. package/lib/esm/test/ecdb/ConcurrentQuery.test.js +2 -2
  149. package/lib/esm/test/ecdb/ConcurrentQuery.test.js.map +1 -1
  150. package/lib/esm/test/ecdb/ECSqlStatement.test.js +33 -2
  151. package/lib/esm/test/ecdb/ECSqlStatement.test.js.map +1 -1
  152. package/lib/esm/test/element/ProjectInformationRecord.test.d.ts +2 -0
  153. package/lib/esm/test/element/ProjectInformationRecord.test.d.ts.map +1 -0
  154. package/lib/esm/test/element/ProjectInformationRecord.test.js +80 -0
  155. package/lib/esm/test/element/ProjectInformationRecord.test.js.map +1 -0
  156. package/lib/esm/test/element/SheetInformationAspect.test.d.ts +2 -0
  157. package/lib/esm/test/element/SheetInformationAspect.test.d.ts.map +1 -0
  158. package/lib/esm/test/element/SheetInformationAspect.test.js +182 -0
  159. package/lib/esm/test/element/SheetInformationAspect.test.js.map +1 -0
  160. package/lib/esm/test/hubaccess/Rebase.test.js +169 -2
  161. package/lib/esm/test/hubaccess/Rebase.test.js.map +1 -1
  162. package/lib/esm/test/imodel/IModel.test.js +175 -2
  163. package/lib/esm/test/imodel/IModel.test.js.map +1 -1
  164. package/lib/esm/test/incrementalSchemaLocater/ECSqlQueries.test.js.map +1 -1
  165. package/lib/esm/test/standalone/ChangesetReader.test.js +63 -60
  166. package/lib/esm/test/standalone/ChangesetReader.test.js.map +1 -1
  167. package/lib/esm/test/standalone/DisplayStyle.test.js +6 -6
  168. package/lib/esm/test/standalone/DisplayStyle.test.js.map +1 -1
  169. package/lib/esm/test/standalone/ElementGraphics.test.js +75 -6
  170. package/lib/esm/test/standalone/ElementGraphics.test.js.map +1 -1
  171. package/lib/esm/test/standalone/RenderMaterialElement.test.js +4 -4
  172. package/lib/esm/test/standalone/RenderMaterialElement.test.js.map +1 -1
  173. package/lib/esm/test/standalone/TxnManager.test.js +33 -5
  174. package/lib/esm/test/standalone/TxnManager.test.js.map +1 -1
  175. package/package.json +13 -13
@@ -1 +1 @@
1
- {"version":3,"file":"ECSqlQueries.test.js","sourceRoot":"","sources":["../../../../src/test/incrementalSchemaLocater/ECSqlQueries.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAA4E,MAAM,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AACvJ,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AACnC,OAAO,KAAK,mBAAmB,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAEpE,GAAG,CAAC,mBAAmB,CAAC,CAAC;AAEzB,SAAS,QAAQ,CAA+B,IAAY,EAAE,OAAY;IACxE,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC,CAAqB,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,IAAI,CAAC,CAAC;IACtE,IAAI,CAAC,IAAI;QACP,MAAM,IAAI,KAAK,CAAC,+BAA+B,IAAI,GAAG,CAAC,CAAC;IAC1D,OAAO,IAAI,CAAC;AACd,CAAC;AAED,SAAS,YAAY,CAA6B,IAAY,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,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,8CAA8C,EAAE,KAAK;QACtD,MAAM,OAAO,GAAG,IAAI,SAAS,CAAC,6BAA6B,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;QACtE,MAAM,qBAAqB,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAElD,MAAM,MAAM,GAAG,MAAM,qBAAqB,CAAC,OAAO,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACtE,IAAI,CAAC,MAAM;YACT,MAAM,IAAI,KAAK,CAAC,yBAAyB,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC;QAE3D,MAAM,gBAAgB,GAAG,MAAM,aAAa,CAAC,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACrG,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAErD,KAAK,MAAM,KAAK,IAAI,gBAAgB,EAAE,CAAC;YACrC,YAAY,CAAC,KAAK,CAAC,IAAK,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { AnyPropertyProps, AnySchemaItemProps, ClassProps, RelationshipClassProps, Schema, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\nimport { IncrementalTestHelper } from \"./utils/IncrementalTestHelper\";\nimport { expect, use } from \"chai\";\nimport * as deepEqualInAnyOrder from \"deep-equal-in-any-order\";\nimport { TestSqlSchemaLocater } from \"./utils/TestSqlSchemaLocater\";\n\nuse(deepEqualInAnyOrder);\n\nfunction findItem<T extends AnySchemaItemProps>(name: string, rowData: T[]) {\n const item = rowData.find((i: AnySchemaItemProps) => i.name === name);\n if (!item)\n throw new Error(`Could not find schema item '${name}'`);\n return item;\n}\n\nfunction findProperty<T extends AnyPropertyProps>(name: string, rowData: T[]) {\n return rowData.find((i: AnyPropertyProps) => i.name === name);\n}\n\nfunction isECClass(item: AnySchemaItemProps): item is ClassProps {\n return item.schemaItemType === SchemaItemType.EntityClass || item.schemaItemType === SchemaItemType.Mixin || item.schemaItemType === SchemaItemType.RelationshipClass ||\n item.schemaItemType === SchemaItemType.StructClass || item.schemaItemType === SchemaItemType.CustomAttributeClass;\n}\n\nfunction isRelationshipClass(item: AnySchemaItemProps): item is RelationshipClassProps {\n return \"source\" in item && \"target\" in item;\n}\n\ndescribe(\"ECSql query tests\", function () {\n let schemaLocater: TestSqlSchemaLocater;\n\n function validateItem(name: string, itemPropObjects: AnySchemaItemProps[], schema: Schema) {\n const actualJson = findItem(name, itemPropObjects);\n const expectedItem = schema.getItemSync(name);\n const expectedJson = expectedItem!.toJSON();\n\n // The following code exists because some data coming from the database will not match the\n // data from the context due to default values. This is OK as long as the conditions are\n // correct. For instance, schemaItem name will not exist in serialized JSON, but does exist\n // coming from the DB. RelationshipConstraint's AbstractConstraint is set when only one\n // constraint class exists coming from the database, but a serialized Relationship will not\n // contain the abstract constraint. The one constraint is 'assumed' to be the abstract constraint.\n\n expect(actualJson.name).to.equal(expectedItem?.name);\n delete (actualJson as any).name;\n\n if (isECClass(actualJson)) {\n if (expectedJson.schemaItemType === \"Mixin\") {\n expect(actualJson.modifier).to.be.oneOf([undefined, 'Abstract']);\n delete (actualJson as any).modifier;\n } else if ((expectedJson as ClassProps).modifier === undefined) {\n expect(actualJson.modifier).to.be.oneOf([undefined, 'None']);\n delete (actualJson as any).modifier;\n }\n }\n if (isRelationshipClass(actualJson)) {\n // abstract can be set via database, but not via context for 1 constraint class\n // so verify constraint and conditions are correct and delete property\n const expectedRelationship = expectedJson as any as RelationshipClassProps;\n if (actualJson.source.abstractConstraint !== expectedRelationship.source.abstractConstraint) {\n expect(actualJson.source.abstractConstraint).to.equal(expectedRelationship.source.constraintClasses[0]);\n expect(actualJson.source.constraintClasses.length).to.equal(1);\n delete (actualJson.source as any).abstractConstraint;\n }\n if (actualJson.target.abstractConstraint !== expectedRelationship.target.abstractConstraint) {\n expect(actualJson.target.abstractConstraint).to.equal(expectedRelationship.target.constraintClasses[0]);\n expect(actualJson.target.constraintClasses.length).to.equal(1);\n delete (actualJson.target as any).abstractConstraint;\n }\n }\n\n if (actualJson.schemaItemType === SchemaItemType.Format) {\n if (undefined !== (actualJson as any).includeZero && undefined === (expectedJson as any).includeZero) {\n expect((actualJson as any).includeZero).to.equal(true);\n delete (actualJson as any).includeZero;\n }\n if ((actualJson as any).composite && undefined !== (actualJson as any).composite.includeZero && undefined === (expectedJson as any).composite.includeZero) {\n expect((actualJson as any).composite.includeZero).to.equal(true);\n delete (actualJson as any).composite.includeZero;\n }\n if ((actualJson as any).composite && undefined !== (actualJson as any).composite.spacer && undefined === (expectedJson as any).composite.spacer) {\n expect((actualJson as any).composite.spacer).to.equal(\" \");\n delete (actualJson as any).composite.spacer;\n }\n if (undefined !== (actualJson as any).decimalSeparator && undefined === (expectedJson as any).decimalSeparator) {\n expect((actualJson as any).decimalSeparator).to.equal(\".\");\n delete (actualJson as any).decimalSeparator;\n }\n if (undefined !== (actualJson as any).roundFactor && undefined === (expectedJson as any).roundFactor) {\n expect((actualJson as any).roundFactor).to.equal(0);\n delete (actualJson as any).roundFactor;\n }\n if (undefined !== (actualJson as any).showSignOption && undefined === (expectedJson as any).showSignOption) {\n expect((actualJson as any).showSignOption).to.equal(\"OnlyNegative\");\n delete (actualJson as any).showSignOption;\n }\n if (undefined !== (actualJson as any).thousandSeparator && undefined === (expectedJson as any).thousandSeparator) {\n expect((actualJson as any).thousandSeparator).to.equal(\",\");\n delete (actualJson as any).thousandSeparator;\n }\n if (undefined !== (actualJson as any).uomSeparator && undefined === (expectedJson as any).uomSeparator) {\n expect((actualJson as any).uomSeparator).to.equal(\" \");\n delete (actualJson as any).uomSeparator;\n }\n if (undefined !== (actualJson as any).spacer && undefined === (expectedJson as any).spacer) {\n expect((actualJson as any).spacer).to.equal(\" \");\n delete (actualJson as any).spacer;\n }\n if (undefined !== (actualJson as any).formatTraits) {\n (actualJson as any).formatTraits = (actualJson as any).formatTraits.map((trait: string) => {\n return trait.charAt(0).toUpperCase() + trait.slice(1);\n });\n }\n }\n\n expect(actualJson).to.deep.equalInAnyOrder(expectedJson);\n }\n\n this.beforeEach(async () => {\n await IncrementalTestHelper.setup();\n schemaLocater = new TestSqlSchemaLocater(IncrementalTestHelper.iModel);\n });\n\n afterEach(async () => {\n await IncrementalTestHelper.close();\n });\n\n it(\"Schema query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"SchemaTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const expectedSchema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!expectedSchema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const actualSchemaProps = await schemaLocater.getSchemaJson(testKey, IncrementalTestHelper.context);\n const actualSchema = await Schema.fromJson(actualSchemaProps!, IncrementalTestHelper.context);\n\n expect(actualSchema.toJSON()).to.deep.equal(expectedSchema?.toJSON());\n });\n\n it(\"Property query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"PropertyTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const classPropsObjects = await schemaLocater.getEntities(testKey.name, IncrementalTestHelper.context);\n const entityOneProps = findItem(\"EntityOne\", classPropsObjects);\n const entityTwoProps = findItem(\"EntityTwo\", classPropsObjects);\n const expectedEntityOne = await schema.getEntityClass(\"EntityOne\");\n const expectedEntityTwo = await schema.getEntityClass(\"EntityTwo\");\n\n const validateProperty = (propertyName: string, actualItem = entityOneProps, expectedItem = expectedEntityOne) => {\n const actualProperty = findProperty(propertyName, actualItem.properties!);\n const expectedProperty = expectedItem?.getPropertySync(propertyName);\n // if maxOccurs is the maximum int value in the context Schema,\n // the property from the DB will not have a value\n if ((expectedProperty as any).maxOccurs === 2147483647) {\n expect((actualProperty as any).maxOccurs).to.be.undefined;\n // set so comparison will pass\n (actualProperty as any).maxOccurs = 2147483647;\n }\n\n expect(actualProperty).to.deep.equal(expectedProperty?.toJSON());\n };\n\n // All but one testable property is in EntityOne\n for (const property of await expectedEntityOne!.getProperties(true)) {\n validateProperty(property.name);\n }\n // Backward direction Navigation property is in EntityTwo\n validateProperty(\"EntityTwoParent\", entityTwoProps, expectedEntityTwo);\n\n });\n\n it(\"Entity query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"EntityTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const classPropsObjects = await schemaLocater.getEntities(testKey.name, IncrementalTestHelper.context);\n expect(classPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"EntityModifierNone\", classPropsObjects, schema);\n validateItem(\"EntityModifierAbstract\", classPropsObjects, schema);\n validateItem(\"EntityModifierSealed\", classPropsObjects, schema);\n });\n\n it(\"Struct query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"StructTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const classPropsObjects = await schemaLocater.getStructs(testKey.name, IncrementalTestHelper.context);\n expect(classPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"StructModifierNone\", classPropsObjects, schema);\n validateItem(\"StructModifierAbstract\", classPropsObjects, schema);\n validateItem(\"StructModifierSealed\", classPropsObjects, schema);\n });\n\n it(\"Mixin query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"MixinTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const classPropsObjects = await schemaLocater.getMixins(testKey.name, IncrementalTestHelper.context);\n expect(classPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"IBaseMixin\", classPropsObjects, schema);\n validateItem(\"ITestMixin\", classPropsObjects, schema);\n });\n\n it(\"Relationship query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"RelationshipTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const classPropsObjects = await schemaLocater.getRelationships(testKey.name, IncrementalTestHelper.context);\n expect(classPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"OwnerOwnsVehicles\", classPropsObjects, schema);\n validateItem(\"OwnerOwnsCars\", classPropsObjects, schema);\n validateItem(\"OwnerOwnsAmericanCars\", classPropsObjects, schema);\n validateItem(\"PhysicalModelBreaksDownCarElement\", classPropsObjects, schema);\n });\n\n it(\"CustomAttributeClass query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"CustomAttributeClassTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const classPropsObjects = await schemaLocater.getCustomAttributeClasses(testKey.name, IncrementalTestHelper.context);\n expect(classPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"CustomAttributeModifierNone\", classPropsObjects, schema);\n validateItem(\"CustomAttributeModifierSealed\", classPropsObjects, schema);\n validateItem(\"CustomAttributeModifierAbstract\", classPropsObjects, schema);\n });\n\n it(\"KindOfQuantity query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"KindOfQuantityTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getKindOfQuantities(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"ACCELERATION\", itemPropsObjects, schema);\n validateItem(\"ANGLE\", itemPropsObjects, schema);\n });\n\n it(\"PropertyCategory query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"PropertyCategoryTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getPropertyCategories(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"PropertyCategory1\", itemPropsObjects, schema);\n validateItem(\"PropertyCategory2\", itemPropsObjects, schema);\n });\n\n it(\"Enumeration query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"EnumerationTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getEnumerations(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"IntEnumeration\", itemPropsObjects, schema);\n validateItem(\"StringEnumeration\", itemPropsObjects, schema);\n });\n\n it(\"Unit query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"UnitTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getUnits(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"LITRE\", itemPropsObjects, schema);\n validateItem(\"GALLON\", itemPropsObjects, schema);\n validateItem(\"ACRE\", itemPropsObjects, schema);\n validateItem(\"FAHRENHEIT\", itemPropsObjects, schema);\n });\n\n it(\"InvertedUnit query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"InvertedUnitTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getInvertedUnits(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"FT_HORIZONTAL_PER_FT_VERTICAL\", itemPropsObjects, schema);\n });\n\n it(\"UnitSystem query, props parsed successfully\", async function () {\n // There's a UnitSystem in there.\n const testKey = new SchemaKey(\"InvertedUnitTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getUnitSystems(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"USCUSTOM\", itemPropsObjects, schema);\n });\n\n it(\"Constant query, props parsed successfully\", async function () {\n // There's a UnitSystem in there.\n const testKey = new SchemaKey(\"ConstantTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getConstants(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"KILO\", itemPropsObjects, schema);\n validateItem(\"HALF_PI\", itemPropsObjects, schema);\n });\n\n it(\"Phenomenon query, props parsed successfully\", async function () {\n // There's a Phenomenon in there.\n const testKey = new SchemaKey(\"ConstantTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getPhenomenon(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"NUMBER\", itemPropsObjects, schema);\n validateItem(\"LENGTH_RATIO\", itemPropsObjects, schema);\n });\n\n it(\"Format Schema parses successfully\", async function () {\n // Using installed Formats schema\n const testKey = new SchemaKey(\"Formats\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getFormats(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n for (const props of itemPropsObjects) {\n validateItem(props.name!, itemPropsObjects, schema);\n }\n });\n\n it(\"Comprehensive Format parses successfully\", async function () {\n const testKey = new SchemaKey(\"FormatTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getFormats(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n for (const props of itemPropsObjects) {\n validateItem(props.name!, itemPropsObjects, schema);\n }\n });\n\n it(\"CustomAttribute instances parse successfully\", async function () {\n const testKey = new SchemaKey(\"CustomAttributeInstanceTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getStructs(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n for (const props of itemPropsObjects) {\n validateItem(props.name!, itemPropsObjects, schema);\n }\n });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,UAAU,CAAC,OAAO,CAAC,IAAI,EAAE,qBAAqB,CAAC,OAAO,CAAC,CAAC;QACrG,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QAErD,KAAK,MAAM,KAAK,IAAI,gBAAgB,EAAE,CAAC;YACrC,YAAY,CAAC,KAAK,CAAC,IAAK,EAAE,gBAAgB,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC;IACH,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC","sourcesContent":["import { AnyPropertyProps, AnySchemaItemProps, ClassProps, RelationshipClassProps, Schema, SchemaItemType, SchemaKey } from \"@itwin/ecschema-metadata\";\nimport { IncrementalTestHelper } from \"./utils/IncrementalTestHelper\";\nimport { expect, use } from \"chai\";\nimport * as deepEqualInAnyOrder from \"deep-equal-in-any-order\";\nimport { TestSqlSchemaLocater } from \"./utils/TestSqlSchemaLocater\";\n\nuse(deepEqualInAnyOrder);\n\nfunction findItem<T extends AnySchemaItemProps>(name: string, rowData: T[]) {\n const item = rowData.find((i: AnySchemaItemProps) => i.name === name);\n if (!item)\n throw new Error(`Could not find schema item '${name}'`);\n return item;\n}\n\nfunction findProperty<T extends AnyPropertyProps>(name: string, rowData: T[]) {\n return rowData.find((i: AnyPropertyProps) => i.name === name);\n}\n\nfunction isECClass(item: AnySchemaItemProps): item is ClassProps {\n return item.schemaItemType === SchemaItemType.EntityClass || item.schemaItemType === SchemaItemType.Mixin || item.schemaItemType === SchemaItemType.RelationshipClass ||\n item.schemaItemType === SchemaItemType.StructClass || item.schemaItemType === SchemaItemType.CustomAttributeClass;\n}\n\nfunction isRelationshipClass(item: AnySchemaItemProps): item is RelationshipClassProps {\n return \"source\" in item && \"target\" in item;\n}\n\ndescribe(\"ECSql query tests\", function () {\n let schemaLocater: TestSqlSchemaLocater;\n\n function validateItem(name: string, itemPropObjects: AnySchemaItemProps[], schema: Schema) {\n const actualJson = findItem(name, itemPropObjects);\n const expectedItem = schema.getItemSync(name);\n const expectedJson = expectedItem!.toJSON();\n\n // The following code exists because some data coming from the database will not match the\n // data from the context due to default values. This is OK as long as the conditions are\n // correct. For instance, schemaItem name will not exist in serialized JSON, but does exist\n // coming from the DB. RelationshipConstraint's AbstractConstraint is set when only one\n // constraint class exists coming from the database, but a serialized Relationship will not\n // contain the abstract constraint. The one constraint is 'assumed' to be the abstract constraint.\n\n expect(actualJson.name).to.equal(expectedItem?.name);\n delete (actualJson as any).name;\n\n if (isECClass(actualJson)) {\n if (expectedJson.schemaItemType === \"Mixin\") {\n expect(actualJson.modifier).to.be.oneOf([undefined, 'Abstract']);\n delete (actualJson as any).modifier;\n } else if ((expectedJson as ClassProps).modifier === undefined) {\n expect(actualJson.modifier).to.be.oneOf([undefined, 'None']);\n delete (actualJson as any).modifier;\n }\n }\n if (isRelationshipClass(actualJson)) {\n // abstract can be set via database, but not via context for 1 constraint class\n // so verify constraint and conditions are correct and delete property\n const expectedRelationship = expectedJson as any as RelationshipClassProps;\n if (actualJson.source.abstractConstraint !== expectedRelationship.source.abstractConstraint) {\n expect(actualJson.source.abstractConstraint).to.equal(expectedRelationship.source.constraintClasses[0]);\n expect(actualJson.source.constraintClasses.length).to.equal(1);\n delete (actualJson.source as any).abstractConstraint;\n }\n if (actualJson.target.abstractConstraint !== expectedRelationship.target.abstractConstraint) {\n expect(actualJson.target.abstractConstraint).to.equal(expectedRelationship.target.constraintClasses[0]);\n expect(actualJson.target.constraintClasses.length).to.equal(1);\n delete (actualJson.target as any).abstractConstraint;\n }\n }\n\n if (actualJson.schemaItemType === SchemaItemType.Format) {\n if (undefined !== (actualJson as any).includeZero && undefined === (expectedJson as any).includeZero) {\n expect((actualJson as any).includeZero).to.equal(true);\n delete (actualJson as any).includeZero;\n }\n if ((actualJson as any).composite && undefined !== (actualJson as any).composite.includeZero && undefined === (expectedJson as any).composite.includeZero) {\n expect((actualJson as any).composite.includeZero).to.equal(true);\n delete (actualJson as any).composite.includeZero;\n }\n if ((actualJson as any).composite && undefined !== (actualJson as any).composite.spacer && undefined === (expectedJson as any).composite.spacer) {\n expect((actualJson as any).composite.spacer).to.equal(\" \");\n delete (actualJson as any).composite.spacer;\n }\n if (undefined !== (actualJson as any).decimalSeparator && undefined === (expectedJson as any).decimalSeparator) {\n expect((actualJson as any).decimalSeparator).to.equal(\".\");\n delete (actualJson as any).decimalSeparator;\n }\n if (undefined !== (actualJson as any).roundFactor && undefined === (expectedJson as any).roundFactor) {\n expect((actualJson as any).roundFactor).to.equal(0);\n delete (actualJson as any).roundFactor;\n }\n if (undefined !== (actualJson as any).showSignOption && undefined === (expectedJson as any).showSignOption) {\n expect((actualJson as any).showSignOption).to.equal(\"OnlyNegative\");\n delete (actualJson as any).showSignOption;\n }\n if (undefined !== (actualJson as any).thousandSeparator && undefined === (expectedJson as any).thousandSeparator) {\n expect((actualJson as any).thousandSeparator).to.equal(\",\");\n delete (actualJson as any).thousandSeparator;\n }\n if (undefined !== (actualJson as any).uomSeparator && undefined === (expectedJson as any).uomSeparator) {\n expect((actualJson as any).uomSeparator).to.equal(\" \");\n delete (actualJson as any).uomSeparator;\n }\n if (undefined !== (actualJson as any).spacer && undefined === (expectedJson as any).spacer) {\n expect((actualJson as any).spacer).to.equal(\" \");\n delete (actualJson as any).spacer;\n }\n if (undefined !== (actualJson as any).formatTraits) {\n (actualJson as any).formatTraits = (actualJson as any).formatTraits.map((trait: string) => {\n return trait.charAt(0).toUpperCase() + trait.slice(1);\n });\n }\n }\n\n expect(actualJson).to.deep.equalInAnyOrder(expectedJson);\n }\n\n this.beforeEach(async () => {\n await IncrementalTestHelper.setup();\n schemaLocater = new TestSqlSchemaLocater(IncrementalTestHelper.iModel);\n });\n\n afterEach(async () => {\n await IncrementalTestHelper.close();\n });\n\n it(\"Schema query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"SchemaTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const expectedSchema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!expectedSchema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const actualSchemaProps = await schemaLocater.getSchemaJson(testKey, IncrementalTestHelper.context);\n const actualSchema = await Schema.fromJson(actualSchemaProps!, IncrementalTestHelper.context);\n\n expect(actualSchema.toJSON()).to.deep.equal(expectedSchema?.toJSON());\n });\n\n it(\"Property query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"PropertyTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const classPropsObjects = await schemaLocater.getEntities(testKey.name, IncrementalTestHelper.context);\n const entityOneProps = findItem(\"EntityOne\", classPropsObjects);\n const entityTwoProps = findItem(\"EntityTwo\", classPropsObjects);\n const expectedEntityOne = await schema.getEntityClass(\"EntityOne\");\n const expectedEntityTwo = await schema.getEntityClass(\"EntityTwo\");\n\n const validateProperty = (propertyName: string, actualItem = entityOneProps, expectedItem = expectedEntityOne) => {\n const actualProperty = findProperty(propertyName, actualItem.properties!);\n const expectedProperty = expectedItem?.getPropertySync(propertyName);\n // if maxOccurs is the maximum int value in the context Schema,\n // the property from the DB will not have a value\n if ((expectedProperty as any).maxOccurs === 2147483647) {\n expect((actualProperty as any).maxOccurs).to.be.undefined;\n // set so comparison will pass\n (actualProperty as any).maxOccurs = 2147483647;\n }\n\n expect(actualProperty).to.deep.equal(expectedProperty?.toJSON());\n };\n\n // All but one testable property is in EntityOne\n for (const property of await expectedEntityOne!.getProperties(true)) {\n validateProperty(property.name);\n }\n // Backward direction Navigation property is in EntityTwo\n validateProperty(\"EntityTwoParent\", entityTwoProps, expectedEntityTwo);\n\n });\n\n it(\"Entity query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"EntityTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const classPropsObjects = await schemaLocater.getEntities(testKey.name, IncrementalTestHelper.context);\n expect(classPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"EntityModifierNone\", classPropsObjects, schema);\n validateItem(\"EntityModifierAbstract\", classPropsObjects, schema);\n validateItem(\"EntityModifierSealed\", classPropsObjects, schema);\n });\n\n it(\"Struct query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"StructTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const classPropsObjects = await schemaLocater.getStructs(testKey.name, IncrementalTestHelper.context);\n expect(classPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"StructModifierNone\", classPropsObjects, schema);\n validateItem(\"StructModifierAbstract\", classPropsObjects, schema);\n validateItem(\"StructModifierSealed\", classPropsObjects, schema);\n });\n\n it(\"Mixin query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"MixinTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const classPropsObjects = await schemaLocater.getMixins(testKey.name, IncrementalTestHelper.context);\n expect(classPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"IBaseMixin\", classPropsObjects, schema);\n validateItem(\"ITestMixin\", classPropsObjects, schema);\n });\n\n it(\"Relationship query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"RelationshipTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const classPropsObjects = await schemaLocater.getRelationships(testKey.name, IncrementalTestHelper.context);\n expect(classPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"OwnerOwnsVehicles\", classPropsObjects, schema);\n validateItem(\"OwnerOwnsCars\", classPropsObjects, schema);\n validateItem(\"OwnerOwnsAmericanCars\", classPropsObjects, schema);\n validateItem(\"PhysicalModelBreaksDownCarElement\", classPropsObjects, schema);\n });\n\n it(\"CustomAttributeClass query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"CustomAttributeClassTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const classPropsObjects = await schemaLocater.getCustomAttributeClasses(testKey.name, IncrementalTestHelper.context);\n expect(classPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"CustomAttributeModifierNone\", classPropsObjects, schema);\n validateItem(\"CustomAttributeModifierSealed\", classPropsObjects, schema);\n validateItem(\"CustomAttributeModifierAbstract\", classPropsObjects, schema);\n });\n\n it(\"KindOfQuantity query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"KindOfQuantityTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getKindOfQuantities(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"ACCELERATION\", itemPropsObjects, schema);\n validateItem(\"ANGLE\", itemPropsObjects, schema);\n });\n\n it(\"PropertyCategory query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"PropertyCategoryTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getPropertyCategories(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"PropertyCategory1\", itemPropsObjects, schema);\n validateItem(\"PropertyCategory2\", itemPropsObjects, schema);\n });\n\n it(\"Enumeration query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"EnumerationTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getEnumerations(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"IntEnumeration\", itemPropsObjects, schema);\n validateItem(\"StringEnumeration\", itemPropsObjects, schema);\n });\n\n it(\"Unit query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"UnitTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getUnits(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"LITRE\", itemPropsObjects, schema);\n validateItem(\"GALLON\", itemPropsObjects, schema);\n validateItem(\"ACRE\", itemPropsObjects, schema);\n validateItem(\"FAHRENHEIT\", itemPropsObjects, schema);\n });\n\n it(\"InvertedUnit query, props parsed successfully\", async function () {\n const testKey = new SchemaKey(\"InvertedUnitTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getInvertedUnits(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"FT_HORIZONTAL_PER_FT_VERTICAL\", itemPropsObjects, schema);\n });\n\n it(\"UnitSystem query, props parsed successfully\", async function () {\n // There's a UnitSystem in there.\n const testKey = new SchemaKey(\"InvertedUnitTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getUnitSystems(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"USCUSTOM\", itemPropsObjects, schema);\n });\n\n it(\"Constant query, props parsed successfully\", async function () {\n // There's a UnitSystem in there.\n const testKey = new SchemaKey(\"ConstantTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getConstants(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"KILO\", itemPropsObjects, schema);\n validateItem(\"HALF_PI\", itemPropsObjects, schema);\n });\n\n it(\"Phenomenon query, props parsed successfully\", async function () {\n // There's a Phenomenon in there.\n const testKey = new SchemaKey(\"ConstantTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getPhenomenon(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n validateItem(\"NUMBER\", itemPropsObjects, schema);\n validateItem(\"LENGTH_RATIO\", itemPropsObjects, schema);\n });\n\n it(\"Format Schema parses successfully\", async function () {\n // Using installed Formats schema\n const testKey = new SchemaKey(\"Formats\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getFormats(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n for (const props of itemPropsObjects) {\n validateItem(props.name!, itemPropsObjects, schema);\n }\n });\n\n it(\"Comprehensive Format parses successfully\", async function () {\n const testKey = new SchemaKey(\"FormatTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getFormats(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n for (const props of itemPropsObjects) {\n validateItem(props.name!, itemPropsObjects, schema);\n }\n });\n\n it(\"CustomAttribute instances parse successfully\", async function () {\n const testKey = new SchemaKey(\"CustomAttributeInstanceTest\", 1, 0, 0);\n await IncrementalTestHelper.importSchema(testKey);\n\n const schema = await IncrementalTestHelper.context.getSchema(testKey);\n if (!schema)\n throw new Error(`Could not find schema ${testKey.name}`);\n\n const itemPropsObjects = await schemaLocater.getStructs(testKey.name, IncrementalTestHelper.context);\n expect(itemPropsObjects.length).to.be.greaterThan(0);\n\n for (const props of itemPropsObjects) {\n validateItem(props.name!, itemPropsObjects, schema);\n }\n });\n});"]}
@@ -163,38 +163,25 @@ describe("Changeset Reader API", async () => {
163
163
  expect(rwIModel[_nativeDb].executeSql("UPDATE ec_Table SET ExclusiveRootClassId=NULL WHERE Name='bis_GeometricElement2d_Overflow'")).to.be.eq(DbResult.BE_SQLITE_OK);
164
164
  const adaptor = new ECChangesetAdaptor(reader);
165
165
  let assertOnOverflowTable = false;
166
- const expectedInserted = {
167
- // eslint-disable-next-line @typescript-eslint/naming-convention
168
- ECClassId: undefined,
169
- // eslint-disable-next-line @typescript-eslint/naming-convention
170
- ECInstanceId: "",
171
- $meta: {
172
- tables: ["bis_GeometricElement2d_Overflow"],
173
- op: "Updated",
174
- classFullName: "BisCore:GeometricElement2d",
175
- fallbackClassId: "0x5e",
176
- changeIndexes: [3],
177
- stage: "New",
178
- },
179
- };
180
- const expectedDeleted = {
181
- // eslint-disable-next-line @typescript-eslint/naming-convention
182
- ECClassId: undefined,
183
- // eslint-disable-next-line @typescript-eslint/naming-convention
184
- ECInstanceId: "",
185
- $meta: {
186
- tables: ["bis_GeometricElement2d_Overflow"],
187
- op: "Updated",
188
- classFullName: "BisCore:GeometricElement2d",
189
- fallbackClassId: "0x5e",
190
- changeIndexes: [3],
191
- stage: "Old",
192
- },
193
- };
166
+ const classId = getClassIdByName(rwIModel, "GeometricElement2d");
194
167
  while (adaptor.step()) {
195
168
  if (adaptor.op === "Updated" && adaptor.inserted?.$meta?.tables[0] === "bis_GeometricElement2d_Overflow") {
196
- assert.deepEqual(adaptor.inserted, expectedInserted);
197
- assert.deepEqual(adaptor.deleted, expectedDeleted);
169
+ assert.isUndefined(adaptor.inserted.ECClassId);
170
+ assert.equal(adaptor.inserted.ECInstanceId, "");
171
+ assert.deepEqual(adaptor.inserted.$meta?.tables, ["bis_GeometricElement2d_Overflow"]);
172
+ assert.equal(adaptor.inserted.$meta?.op, "Updated");
173
+ assert.equal(adaptor.inserted.$meta?.classFullName, "BisCore:GeometricElement2d");
174
+ assert.equal(adaptor.inserted.$meta.fallbackClassId, classId);
175
+ assert.deepEqual(adaptor.inserted.$meta?.changeIndexes, [3]);
176
+ assert.equal(adaptor.inserted.$meta?.stage, "New");
177
+ assert.equal(adaptor.deleted.ECInstanceId, "");
178
+ assert.isUndefined(adaptor.deleted.ECClassId);
179
+ assert.deepEqual(adaptor.deleted.$meta?.tables, ["bis_GeometricElement2d_Overflow"]);
180
+ assert.equal(adaptor.deleted.$meta?.op, "Updated");
181
+ assert.equal(adaptor.deleted.$meta?.classFullName, "BisCore:GeometricElement2d");
182
+ assert.equal(adaptor.deleted.$meta.fallbackClassId, classId);
183
+ assert.deepEqual(adaptor.deleted.$meta?.changeIndexes, [3]);
184
+ assert.equal(adaptor.deleted.$meta?.stage, "Old");
198
185
  assertOnOverflowTable = true;
199
186
  }
200
187
  }
@@ -209,6 +196,12 @@ describe("Changeset Reader API", async () => {
209
196
  return stmt.getValue(0).getId();
210
197
  });
211
198
  }
199
+ async function getClassNameById(iModel, classId) {
200
+ const reader = iModel.createQueryReader(`select ec_classname(${classId});`);
201
+ if (await reader.step())
202
+ return reader.current[0];
203
+ return undefined;
204
+ }
212
205
  it("Changeset reader / EC adaptor", async () => {
213
206
  const adminToken = "super manager token";
214
207
  const iModelName = "test";
@@ -292,7 +285,7 @@ describe("Changeset Reader API", async () => {
292
285
  };
293
286
  rwIModel.saveChanges("user 1: data");
294
287
  if (true || "test local changes") {
295
- const testChanges = (changes) => {
288
+ const testChanges = async (changes) => {
296
289
  assert.equal(changes.length, 3);
297
290
  assert.equal(changes[0].ECInstanceId, "0x20000000001");
298
291
  assert.equal(changes[0].$meta?.classFullName, "BisCore:DrawingModel");
@@ -318,8 +311,10 @@ describe("Changeset Reader API", async () => {
318
311
  assert.deepEqual(el.BBoxLow, { X: -25, Y: -25 });
319
312
  // eslint-disable-next-line @typescript-eslint/naming-convention
320
313
  assert.deepEqual(el.BBoxHigh, { X: 15, Y: 15 });
321
- // eslint-disable-next-line @typescript-eslint/naming-convention
322
- assert.deepEqual(el.Category, { Id: "0x20000000002", RelECClassId: "0x6d" });
314
+ assert.equal(el.Category.Id, "0x20000000002");
315
+ assert.isNotEmpty(el.Category.RelECClassId);
316
+ const categoryRelClass = await getClassNameById(rwIModel, el.Category.RelECClassId);
317
+ assert.equal("BisCore:GeometricElement2dIsInCategory", categoryRelClass);
323
318
  assert.equal(el.s, "xxxxxxxxx");
324
319
  assert.isNull(el.CodeValue);
325
320
  assert.isNull(el.UserLabel);
@@ -331,12 +326,14 @@ describe("Changeset Reader API", async () => {
331
326
  assert.deepEqual(el.Parent, { Id: null, RelECClassId: null });
332
327
  // eslint-disable-next-line @typescript-eslint/naming-convention
333
328
  assert.deepEqual(el.TypeDefinition, { Id: null, RelECClassId: null });
334
- // eslint-disable-next-line @typescript-eslint/naming-convention
335
- assert.deepEqual(el.Category, { Id: "0x20000000002", RelECClassId: "0x6d" });
336
- // eslint-disable-next-line @typescript-eslint/naming-convention
337
- assert.deepEqual(el.CodeSpec, { Id: "0x1", RelECClassId: "0x69" });
338
- // eslint-disable-next-line @typescript-eslint/naming-convention
339
- assert.deepEqual(el.CodeScope, { Id: "0x1", RelECClassId: "0x6b" });
329
+ assert.equal(el.CodeSpec.Id, "0x1");
330
+ assert.isNotEmpty(el.CodeSpec.RelECClassId);
331
+ const codeSpecRelClass = await getClassNameById(rwIModel, el.CodeSpec.RelECClassId);
332
+ assert.equal("BisCore:CodeSpecSpecifiesCode", codeSpecRelClass);
333
+ assert.equal(el.CodeScope.Id, "0x1");
334
+ assert.isNotEmpty(el.CodeScope.RelECClassId);
335
+ const codeScopeRelClass = await getClassNameById(rwIModel, el.CodeScope.RelECClassId);
336
+ assert.equal("BisCore:ElementScopesCode", codeScopeRelClass);
340
337
  assert.deepEqual(el.$meta, {
341
338
  tables: [
342
339
  "bis_GeometricElement2d",
@@ -360,7 +357,7 @@ describe("Changeset Reader API", async () => {
360
357
  while (adaptor.step()) {
361
358
  pcu.appendFrom(adaptor);
362
359
  }
363
- testChanges(Array.from(pcu.instances));
360
+ await testChanges(Array.from(pcu.instances));
364
361
  }
365
362
  catch (e_1) {
366
363
  env_1.error = e_1;
@@ -379,7 +376,7 @@ describe("Changeset Reader API", async () => {
379
376
  while (adaptor.step()) {
380
377
  pcu.appendFrom(adaptor);
381
378
  }
382
- testChanges(Array.from(pcu.instances));
379
+ await testChanges(Array.from(pcu.instances));
383
380
  }
384
381
  catch (e_2) {
385
382
  env_2.error = e_2;
@@ -515,7 +512,7 @@ describe("Changeset Reader API", async () => {
515
512
  }
516
513
  }
517
514
  if (true || "test changeset file") {
518
- const testChanges = (changes) => {
515
+ const testChanges = async (changes) => {
519
516
  assert.equal(changes.length, 3);
520
517
  assert.equal(changes[0].ECInstanceId, "0x20000000001");
521
518
  assert.equal(changes[0].$meta?.classFullName, "BisCore:DrawingModel");
@@ -541,8 +538,10 @@ describe("Changeset Reader API", async () => {
541
538
  assert.deepEqual(el.BBoxLow, { X: -25, Y: -25 });
542
539
  // eslint-disable-next-line @typescript-eslint/naming-convention
543
540
  assert.deepEqual(el.BBoxHigh, { X: 15, Y: 15 });
544
- // eslint-disable-next-line @typescript-eslint/naming-convention
545
- assert.deepEqual(el.Category, { Id: "0x20000000002", RelECClassId: "0x6d" });
541
+ assert.equal(el.Category.Id, "0x20000000002");
542
+ assert.isNotEmpty(el.Category.RelECClassId);
543
+ const categoryRelClass = await getClassNameById(rwIModel, el.Category.RelECClassId);
544
+ assert.equal("BisCore:GeometricElement2dIsInCategory", categoryRelClass);
546
545
  assert.equal(el.s, "xxxxxxxxx");
547
546
  assert.isNull(el.CodeValue);
548
547
  assert.isNull(el.UserLabel);
@@ -554,12 +553,14 @@ describe("Changeset Reader API", async () => {
554
553
  assert.deepEqual(el.Parent, { Id: null, RelECClassId: null });
555
554
  // eslint-disable-next-line @typescript-eslint/naming-convention
556
555
  assert.deepEqual(el.TypeDefinition, { Id: null, RelECClassId: null });
557
- // eslint-disable-next-line @typescript-eslint/naming-convention
558
- assert.deepEqual(el.Category, { Id: "0x20000000002", RelECClassId: "0x6d" });
559
- // eslint-disable-next-line @typescript-eslint/naming-convention
560
- assert.deepEqual(el.CodeSpec, { Id: "0x1", RelECClassId: "0x69" });
561
- // eslint-disable-next-line @typescript-eslint/naming-convention
562
- assert.deepEqual(el.CodeScope, { Id: "0x1", RelECClassId: "0x6b" });
556
+ assert.equal(el.CodeSpec.Id, "0x1");
557
+ assert.isNotEmpty(el.CodeSpec.RelECClassId);
558
+ const codeSpecRelClass = await getClassNameById(rwIModel, el.CodeSpec.RelECClassId);
559
+ assert.equal("BisCore:CodeSpecSpecifiesCode", codeSpecRelClass);
560
+ assert.equal(el.CodeScope.Id, "0x1");
561
+ assert.isNotEmpty(el.CodeScope.RelECClassId);
562
+ const codeScopeRelClass = await getClassNameById(rwIModel, el.CodeScope.RelECClassId);
563
+ assert.equal("BisCore:ElementScopesCode", codeScopeRelClass);
563
564
  assert.deepEqual(el.$meta, {
564
565
  tables: [
565
566
  "bis_GeometricElement2d",
@@ -583,7 +584,7 @@ describe("Changeset Reader API", async () => {
583
584
  while (adaptor.step()) {
584
585
  pcu.appendFrom(adaptor);
585
586
  }
586
- testChanges(Array.from(pcu.instances));
587
+ await testChanges(Array.from(pcu.instances));
587
588
  }
588
589
  catch (e_7) {
589
590
  env_7.error = e_7;
@@ -602,7 +603,7 @@ describe("Changeset Reader API", async () => {
602
603
  while (adaptor.step()) {
603
604
  pcu.appendFrom(adaptor);
604
605
  }
605
- testChanges(Array.from(pcu.instances));
606
+ await testChanges(Array.from(pcu.instances));
606
607
  }
607
608
  catch (e_8) {
608
609
  env_8.error = e_8;
@@ -1284,15 +1285,15 @@ describe("Changeset Reader API", async () => {
1284
1285
  assert.equal(secondBriefcaseChangesets.length, 2);
1285
1286
  const [secondBriefcaseChangeset1, secondBriefcaseChangeset2] = secondBriefcaseChangesets;
1286
1287
  expect(secondBriefcaseChangeset1.uncompressedSizeBytes).to.be.greaterThan(40000);
1287
- expect(secondBriefcaseChangeset1.insertedRows).to.be.greaterThanOrEqual(52);
1288
+ expect(secondBriefcaseChangeset1.insertedRows).to.be.eql(0);
1288
1289
  expect(secondBriefcaseChangeset1.updatedRows).to.be.greaterThanOrEqual(921);
1289
- expect(secondBriefcaseChangeset1.deletedRows).to.be.eql(0);
1290
+ expect(secondBriefcaseChangeset1.deletedRows).to.be.greaterThanOrEqual(52);
1290
1291
  expect(secondBriefcaseChangeset1.totalFullTableScans).to.be.eql(0);
1291
1292
  expect(secondBriefcaseChangeset1.perStatementStats.length).to.be.eql(11);
1292
1293
  expect(secondBriefcaseChangeset2.uncompressedSizeBytes).to.be.greaterThan(40000);
1293
- expect(secondBriefcaseChangeset2.insertedRows).to.be.eql(0);
1294
+ expect(secondBriefcaseChangeset2.insertedRows).to.be.greaterThanOrEqual(52);
1294
1295
  expect(secondBriefcaseChangeset2.updatedRows).to.be.greaterThanOrEqual(921);
1295
- expect(secondBriefcaseChangeset2.deletedRows).to.be.greaterThanOrEqual(52);
1296
+ expect(secondBriefcaseChangeset2.deletedRows).to.be.eql(0);
1296
1297
  expect(secondBriefcaseChangeset2.totalFullTableScans).to.be.eql(0);
1297
1298
  expect(secondBriefcaseChangeset2.perStatementStats.length).to.be.eql(11);
1298
1299
  // Cleanup
@@ -1347,6 +1348,7 @@ describe("Changeset Reader API", async () => {
1347
1348
  await rwIModel.locks.acquireLocks({ shared: drawingModelId });
1348
1349
  const e1id = rwIModel.elements.insertElement(e1);
1349
1350
  assert.isTrue(Id64.isValidId64(e1id), "insert worked");
1351
+ const testElClassId = getClassIdByName(rwIModel, "Test2dElement");
1350
1352
  if (true) {
1351
1353
  const reader = SqliteChangesetReader.openInMemory({ db: rwIModel, disableSchemaCheck: true });
1352
1354
  const adaptor = new ChangesetECAdaptor(reader);
@@ -1362,7 +1364,7 @@ describe("Changeset Reader API", async () => {
1362
1364
  expect(testEl.$meta?.op).to.equals("Inserted");
1363
1365
  expect(testEl.$meta?.classFullName).to.equals("TestDomain:Test2dElement");
1364
1366
  expect(testEl.$meta?.stage).to.equals("New");
1365
- expect(testEl.ECClassId).to.equals("0x168");
1367
+ expect(testEl.ECClassId).to.equals(testElClassId);
1366
1368
  expect(testEl.ECInstanceId).to.equals(e1id);
1367
1369
  expect(testEl.Model.Id).to.equals(drawingModelId);
1368
1370
  expect(testEl.Category.Id).to.equals(drawingCategoryId);
@@ -1390,12 +1392,13 @@ describe("Changeset Reader API", async () => {
1390
1392
  // verify the inserted element's properties
1391
1393
  const instances = Array.from(unifier.instances);
1392
1394
  expect(instances.length).to.equals(3);
1395
+ const drawingModelClassId = getClassIdByName(rwIModel, "DrawingModel");
1393
1396
  // DrawingModel new instance
1394
1397
  const drawingModelElNew = instances[0];
1395
1398
  expect(drawingModelElNew.$meta?.op).to.equals("Updated");
1396
1399
  expect(drawingModelElNew.$meta?.classFullName).to.equals("BisCore:DrawingModel");
1397
1400
  expect(drawingModelElNew.$meta?.stage).to.equals("New");
1398
- expect(drawingModelElNew.ECClassId).to.equals("0xaa");
1401
+ expect(drawingModelElNew.ECClassId).to.equals(drawingModelClassId);
1399
1402
  expect(drawingModelElNew.ECInstanceId).to.equals(drawingModelId);
1400
1403
  expect(drawingModelElNew.LastMod).to.exist;
1401
1404
  expect(drawingModelElNew.GeometryGuid).to.exist;
@@ -1404,7 +1407,7 @@ describe("Changeset Reader API", async () => {
1404
1407
  expect(drawingModelElOld.$meta?.op).to.equals("Updated");
1405
1408
  expect(drawingModelElOld.$meta?.classFullName).to.equals("BisCore:DrawingModel");
1406
1409
  expect(drawingModelElOld.$meta?.stage).to.equals("Old");
1407
- expect(drawingModelElOld.ECClassId).to.equals("0xaa");
1410
+ expect(drawingModelElOld.ECClassId).to.equals(drawingModelClassId);
1408
1411
  expect(drawingModelElOld.ECInstanceId).to.equals(drawingModelId);
1409
1412
  expect(drawingModelElOld.LastMod).to.null;
1410
1413
  expect(drawingModelElOld.GeometryGuid).to.null;
@@ -1413,7 +1416,7 @@ describe("Changeset Reader API", async () => {
1413
1416
  expect(testEl.$meta?.op).to.equals("Inserted");
1414
1417
  expect(testEl.$meta?.classFullName).to.equals("TestDomain:Test2dElement");
1415
1418
  expect(testEl.$meta?.stage).to.equals("New");
1416
- expect(testEl.ECClassId).to.equals("0x168");
1419
+ expect(testEl.ECClassId).to.equals(testElClassId);
1417
1420
  expect(testEl.ECInstanceId).to.equals(e1id);
1418
1421
  expect(testEl.Model.Id).to.equals(drawingModelId);
1419
1422
  expect(testEl.Category.Id).to.equals(drawingCategoryId);