import { expect } from "chai" ; import { ButtonGroupEditorParams , ColorEditorParams , CustomFormattedNumberParams , IconListEditorParams , InputEditorSizeParams , isButtonGroupEditorParams , isColorEditorParams , isCustomFormattedNumberParams , isIconListEditorParams , isInputEditorSizeParams , isSuppressLabelEditorParams , PropertyEditorParamTypes , SuppressLabelEditorParams , } from "../../appui-abstract" ; describe ( "EditorParams" , ( ) => { it ( "should evaluate types correctly" , ( ) => { const ieParams = { type : PropertyEditorParamTypes . InputEditorSize , size : 20 , maxLength : 50 } ; expect ( isInputEditorSizeParams ( ieParams ) ) . to . be . true ; const colorParams = { type : PropertyEditorParamTypes . ColorData , colorValues : [ 5 , 6 , 7 ] , numColumns : 3 } ; expect ( isColorEditorParams ( colorParams ) ) . to . be . true ; const iconListParams = { type : PropertyEditorParamTypes . IconListData , iconValue : "icon-placeholder" , iconValues : [ "icon-placeholder" , "icon-2" , "icon-3" ] , numColumns : 1 } ; expect ( isIconListEditorParams ( iconListParams ) ) . to . be . true ; const bgParams = { type : PropertyEditorParamTypes . ButtonGroupData , buttons : [ { iconSpec : "iconspec-1" } , { iconSpec : "iconspec-2" } ] } ; expect ( isButtonGroupEditorParams ( bgParams ) ) . to . be . true ; const suppressParams = { type : PropertyEditorParamTypes . SuppressEditorLabel } ; expect ( isSuppressLabelEditorParams ( suppressParams ) ) . to . be . true ; const customParams = { type : PropertyEditorParamTypes . CustomFormattedNumber , formatFunction : ( numberValue ) => `${ numberValue }` , parseFunction : ( _stringValue ) => { return { value : 1.0 } ; } } ; expect ( isCustomFormattedNumberParams ( customParams ) ) . to . be . true ; } ) ; } ) ;