@@ -1006,6 +1006,67 @@ module('Object Inspector', function (hooks) {
1006
1006
assert . dom ( '[data-test-object-property-value]' ) . hasText ( date . toString ( ) ) ;
1007
1007
} ) ;
1008
1008
1009
+ test ( 'Boolean fields are editable' , async function ( assert ) {
1010
+ assert . expect ( 4 ) ;
1011
+
1012
+ await visit ( '/' ) ;
1013
+
1014
+ await sendMessage ( {
1015
+ type : 'objectInspector:updateObject' ,
1016
+ name : 'My Object' ,
1017
+ objectId : 'myObject' ,
1018
+ details : [
1019
+ {
1020
+ name : 'First Detail' ,
1021
+ expand : false ,
1022
+ properties : [
1023
+ {
1024
+ name : 'booleanProperty' ,
1025
+ value : {
1026
+ inspect : true . toString ( ) ,
1027
+ type : 'type-boolean' ,
1028
+ isCalculated : true ,
1029
+ } ,
1030
+ } ,
1031
+ ] ,
1032
+ } ,
1033
+ ] ,
1034
+ } ) ;
1035
+
1036
+ respondWith (
1037
+ 'objectInspector:saveProperty' ,
1038
+ ( { objectId, property, value } ) => {
1039
+ assert . strictEqual ( typeof value , 'boolean' , 'sent as boolean' ) ;
1040
+
1041
+ return {
1042
+ type : 'objectInspector:updateProperty' ,
1043
+ objectId,
1044
+ property,
1045
+ mixinIndex : 0 ,
1046
+ value : {
1047
+ inspect : false . toString ( ) ,
1048
+ type : 'type-boolean' ,
1049
+ isCalculated : false ,
1050
+ } ,
1051
+ } ;
1052
+ }
1053
+ ) ;
1054
+
1055
+ await click ( '[data-test-object-detail-name]' ) ;
1056
+
1057
+ assert . dom ( '[data-test-object-property-value]' ) . hasText ( true . toString ( ) ) ;
1058
+
1059
+ await click ( '[data-test-object-property-value]' ) ;
1060
+
1061
+ let field = find ( '[data-test-object-property-value-txt]' ) ;
1062
+ assert . ok ( field ) ;
1063
+
1064
+ await fillIn ( field , 'false' ) ;
1065
+ await triggerKeyEvent ( field , 'keyup' , 13 ) ;
1066
+
1067
+ assert . dom ( '[data-test-object-property-value]' ) . hasText ( false . toString ( ) ) ;
1068
+ } ) ;
1069
+
1009
1070
test ( 'Errors are correctly displayed' , async function ( assert ) {
1010
1071
assert . expect ( 8 ) ;
1011
1072
0 commit comments