@@ -810,6 +810,28 @@ test("bindings property editor", () => {
810
810
q . value = "q3" ;
811
811
expect ( matrix . bindings . getValueNameByPropertyName ( "rowCount" ) ) . toEqual ( "q3" ) ;
812
812
} ) ;
813
+ test ( "bindings property editor, store in JSON, Bug#6743" , ( ) => {
814
+ const survey = new SurveyModel ( {
815
+ elements : [
816
+ { type : "matrixdynamic" , name : "q1" } ,
817
+ { type : "text" , name : "q2" }
818
+ ]
819
+ } ) ;
820
+ const matrix = < QuestionMatrixDynamicModel > survey . getQuestionByName ( "q1" ) ;
821
+ const propertyGrid = new PropertyGridModelTester ( matrix ) ;
822
+ const bindingsQuestion = < QuestionCompositeModel > (
823
+ propertyGrid . survey . getQuestionByName ( "bindings" )
824
+ ) ;
825
+ expect ( bindingsQuestion ) . toBeTruthy ( ) ;
826
+ expect ( bindingsQuestion . getType ( ) ) . toEqual ( "propertygrid_bindings" ) ;
827
+ expect ( bindingsQuestion . contentPanel . questions ) . toHaveLength ( 1 ) ;
828
+ const q = bindingsQuestion . contentPanel . questions [ 0 ] ;
829
+ expect ( q . name ) . toEqual ( "rowCount" ) ;
830
+ q . value = "q2" ;
831
+ expect ( matrix . bindings . getValueNameByPropertyName ( "rowCount" ) ) . toEqual ( "q2" ) ;
832
+ expect ( matrix . toJSON ( ) ) . toEqual ( { name : "q1" , bindings : { rowCount : "q2" } } ) ;
833
+ expect ( survey . getQuestionByName ( "q2" ) . toJSON ( ) ) . toEqual ( { name : "q2" } ) ;
834
+ } ) ;
813
835
814
836
test ( "Dynamic panel 'Panel count' binding property editor" , ( ) => {
815
837
const survey = new SurveyModel ( {
0 commit comments