@@ -567,7 +567,9 @@ describe("metadata-generator", function() {
567567 Options : {
568568 property : {
569569 Options : {
570- nestedProperty1 : { }
570+ nestedProperty1 : {
571+ PrimitiveTypes : [ 'number' ]
572+ }
571573 } ,
572574 PrimitiveTypes : [
573575 'string'
@@ -587,7 +589,9 @@ describe("metadata-generator", function() {
587589 Options : {
588590 property : {
589591 Options : {
590- nestedProperty2 : { }
592+ nestedProperty2 : {
593+ PrimitiveTypes : [ 'string' ]
594+ }
591595 } ,
592596 PrimitiveTypes : [
593597 'boolean' ,
@@ -655,9 +659,11 @@ describe("metadata-generator", function() {
655659 it ( "should generate nested components with merged types of repetitive properties" , function ( ) {
656660 expect ( metas . DxoExternalProperty . properties . map ( p => p . type ) )
657661 . toEqual ( [
658- 'string' + TYPES_SEPORATOR +
662+ 'string' + TYPES_SEPORATOR +
663+ '{ nestedProperty1?: number }' + TYPES_SEPORATOR +
659664 'boolean' + TYPES_SEPORATOR +
660- 'DevExpress.ui.dxComplexType' ,
665+ 'DevExpress.ui.dxComplexType' + TYPES_SEPORATOR +
666+ '{ nestedProperty2?: string }' ,
661667 'string' ,
662668 'any' ,
663669 'any'
@@ -689,6 +695,29 @@ describe("metadata-generator", function() {
689695 ComplexTypes : [
690696 'ExternalPropertyType'
691697 ]
698+ } ,
699+ collectionDeeps : {
700+ PrimitiveTypes : [
701+ "boolean"
702+ ] ,
703+ ItemPrimitiveTypes : [
704+ "number"
705+ ] ,
706+ Options : {
707+ value : {
708+ PrimitiveTypes : [
709+ "string"
710+ ]
711+ }
712+ } ,
713+ IsCollection : true ,
714+ SingularName : "collectionDeep"
715+ } ,
716+ deepWithPromise : {
717+ IsPromise : true ,
718+ ItemPrimitiveTypes : [
719+ "boolean"
720+ ]
692721 }
693722 } ,
694723 PrimitiveTypes : [
@@ -763,7 +792,7 @@ describe("metadata-generator", function() {
763792 } ) ;
764793
765794 it ( "should generate matadata" , function ( ) {
766- expect ( Object . keys ( metas ) . length ) . toBe ( 9 ) ;
795+ expect ( Object . keys ( metas ) . length ) . toBe ( 10 ) ;
767796
768797 expect ( metas . DxComplexWidget ) . not . toBe ( undefined ) ;
769798 expect ( metas . DxoExternalPropertyType ) . not . toBe ( undefined ) ;
@@ -774,12 +803,17 @@ describe("metadata-generator", function() {
774803 expect ( metas . DxiNestedItem ) . not . toBe ( undefined ) ;
775804 expect ( metas . DxiCollectionItem ) . not . toBe ( undefined ) ;
776805 expect ( metas . DxoCollectionItem ) . not . toBe ( undefined ) ;
806+ expect ( metas . DxiCollectionDeep ) . not . toBe ( undefined ) ;
777807 } ) ;
778808
779809 it ( "should generate proper typed properties" , function ( ) {
780810 expect ( metas . DxoProperty . properties . map ( p => p . type ) ) . toEqual ( [
781- 'string' + TYPES_SEPORATOR + 'DevExpress.ui.ComplexType' ,
782- 'Array<string' + TYPES_SEPORATOR + 'DevExpress.ui.ComplexType>'
811+ `string${ TYPES_SEPORATOR } DevExpress.ui.ComplexType${ TYPES_SEPORATOR } ` +
812+ `{ deep?: boolean${ TYPES_SEPORATOR } DevExpress.ui.ComplexType, ` +
813+ `collectionDeeps?: boolean${ TYPES_SEPORATOR } Array<number${ TYPES_SEPORATOR } { value?: string }>, ` +
814+ `deepWithPromise?: Promise<boolean> & JQueryPromise<boolean> }` ,
815+
816+ `Array<string${ TYPES_SEPORATOR } DevExpress.ui.ComplexType${ TYPES_SEPORATOR } { deep?: string }>`
783817 ] ) ;
784818 } ) ;
785819
0 commit comments