@@ -497,6 +497,18 @@ class AssetInterfaceDescriptionUtilTest {
497497 } ,
498498 ] ,
499499 } ,
500+ temperature : {
501+ description : "Temperature value of the weather station" ,
502+ type : "number" ,
503+ minimum : - 32.5 ,
504+ maximum : 55.2 ,
505+ unit : "degreeCelsius" ,
506+ forms : [
507+ {
508+ href : "temp" ,
509+ } ,
510+ ] ,
511+ } ,
500512 } ,
501513 } ;
502514
@@ -586,7 +598,7 @@ class AssetInterfaceDescriptionUtilTest {
586598 . to . be . an ( "array" )
587599 . to . have . lengthOf . greaterThan ( 0 ) ;
588600 let hasPropertyStatus = false ;
589- let hasPropertyStatusDescription = false ;
601+ let hasPropertyTemperature = false ;
590602 for ( const propertyValue of interactionValues . value ) {
591603 if ( propertyValue . idShort === "status" ) {
592604 hasPropertyStatus = true ;
@@ -598,6 +610,7 @@ class AssetInterfaceDescriptionUtilTest {
598610 let hasTitle = false ;
599611 let hasObservable = false ;
600612 let hasForms = false ;
613+ let hasPropertyStatusDescription = false ;
601614 for ( const propProperty of propertyValue . value ) {
602615 if ( propProperty . idShort === "type" ) {
603616 hasType = true ;
@@ -636,29 +649,58 @@ class AssetInterfaceDescriptionUtilTest {
636649 expect ( hasHtvMethodName ) . to . equal ( true ) ;
637650 }
638651 }
652+ if ( propertyValue . description != null ) {
653+ hasPropertyStatusDescription = true ;
654+ expect ( propertyValue )
655+ . to . have . property ( "description" )
656+ . to . eql ( [
657+ {
658+ language : "en" ,
659+ text : "Statistic" ,
660+ } ,
661+ {
662+ language : "de" ,
663+ text : "Statistik" ,
664+ } ,
665+ ] ) ;
666+ }
639667 expect ( hasType ) . to . equal ( true ) ;
640668 expect ( hasTitle ) . to . equal ( false ) ;
641669 expect ( hasObservable ) . to . equal ( true ) ;
642670 expect ( hasForms ) . to . equal ( true ) ;
643- }
644- if ( propertyValue . description != null ) {
645- hasPropertyStatusDescription = true ;
671+ expect ( hasPropertyStatusDescription ) . to . equal ( true ) ;
672+ } else if ( propertyValue . idShort === "temperature" ) {
673+ hasPropertyTemperature = true ;
646674 expect ( propertyValue )
647- . to . have . property ( "description" )
648- . to . eql ( [
649- {
650- language : "en" ,
651- text : "Statistic" ,
652- } ,
653- {
654- language : "de" ,
655- text : "Statistik" ,
656- } ,
657- ] ) ;
675+ . to . have . property ( "value" )
676+ . to . be . an ( "array" )
677+ . to . have . lengthOf . greaterThan ( 0 ) ;
678+ let hasType = false ;
679+ let hasDescription = false ;
680+ let hasUnit = false ;
681+ let hasForms = false ;
682+ for ( const propProperty of propertyValue . value ) {
683+ if ( propProperty . idShort === "type" ) {
684+ hasType = true ;
685+ expect ( propProperty . value ) . to . equal ( "number" ) ;
686+ } else if ( propProperty . idShort === "description" ) {
687+ hasDescription = true ;
688+ expect ( propProperty . value ) . to . equal ( "Temperature value of the weather station" ) ;
689+ } else if ( propProperty . idShort === "unit" ) {
690+ hasUnit = true ;
691+ expect ( propProperty . value ) . to . equal ( "degreeCelsius" ) ;
692+ } else if ( propProperty . idShort === "forms" ) {
693+ hasForms = true ;
694+ }
695+ }
696+ expect ( hasType ) . to . equal ( true ) ;
697+ expect ( hasDescription ) . to . equal ( true ) ;
698+ expect ( hasUnit ) . to . equal ( true ) ;
699+ expect ( hasForms ) . to . equal ( true ) ;
658700 }
659701 }
660702 expect ( hasPropertyStatus ) . to . equal ( true ) ;
661- expect ( hasPropertyStatusDescription ) . to . equal ( true ) ;
703+ expect ( hasPropertyTemperature ) . to . equal ( true ) ;
662704 }
663705 }
664706 expect ( hasProperties ) . to . equal ( true ) ;
0 commit comments