@@ -3739,3 +3739,68 @@ QUnit.test("Panel.validate vs callback function as a parameter #10307", function
37393739
37403740 FunctionFactory . Instance . unregister ( "asyncFunc" ) ;
37413741} ) ;
3742+ QUnit . test ( "page questionStartIndex, Issue#10523" , function ( assert ) {
3743+ const survey = new SurveyModel ( {
3744+ pages : [ {
3745+ elements : [
3746+ {
3747+ type : "text" ,
3748+ name : "q1"
3749+ } ] } ,
3750+ {
3751+ elements : [
3752+ {
3753+ type : "text" ,
3754+ name : "q2"
3755+ } ] } ,
3756+ {
3757+ questionStartIndex : "A.1" ,
3758+ elements : [
3759+ {
3760+ type : "panel" , name : "p1" , title : "Panel" ,
3761+ elements : [
3762+ { type : "text" , name : "q3" } ,
3763+ { type : "text" , name : "q4" }
3764+ ]
3765+ } ,
3766+ ] } ,
3767+ { elements : [
3768+ { type : "text" , name : "q5" } ,
3769+ {
3770+ type : "panel" , name : "p2" , title : "Panel" ,
3771+ elements : [
3772+ { type : "text" , name : "q6" } ,
3773+ { type : "text" , name : "q7" }
3774+ ]
3775+ } ]
3776+ } ] ,
3777+ showQuestionNumbers : "recursive" ,
3778+ questionStartIndex : "1.1"
3779+ } ) ;
3780+ assert . equal ( survey . pages [ 1 ] . visibleIndex , 1 , "page2.visibleIndex, #1" ) ;
3781+ assert . equal ( survey . pages [ 1 ] . num , 2 , "page2.num, #2" ) ;
3782+ assert . equal ( survey . pages [ 2 ] . questionStartIndex , "A.1" , "questionStartIndex, #1" ) ;
3783+ assert . equal ( survey . pages [ 2 ] . visibleIndex , 2 , "page2.visibleIndex, #1" ) ;
3784+ assert . equal ( survey . pages [ 2 ] . num , 1 , "page2.num, #2" ) ;
3785+ assert . equal ( survey . pages [ 3 ] . visibleIndex , 3 , "page3.visibleIndex, #1" ) ;
3786+ assert . equal ( survey . pages [ 3 ] . num , 2 , "page3.num, #1" ) ;
3787+ const q1 = survey . getQuestionByName ( "q1" ) ;
3788+ const q2 = survey . getQuestionByName ( "q2" ) ;
3789+ const q3 = survey . getQuestionByName ( "q3" ) ;
3790+ const q4 = survey . getQuestionByName ( "q4" ) ;
3791+ const q5 = survey . getQuestionByName ( "q5" ) ;
3792+ const q6 = survey . getQuestionByName ( "q6" ) ;
3793+ const q7 = survey . getQuestionByName ( "q7" ) ;
3794+ const p1 = survey . getPanelByName ( "p1" ) ;
3795+ const p2 = survey . getPanelByName ( "p2" ) ;
3796+
3797+ assert . equal ( q1 . no , "1.1" , "q1, #1" ) ;
3798+ assert . equal ( q2 . no , "2.1" , "q2, #1" ) ;
3799+ assert . equal ( p1 . no , "A.1" , "panel1, #1" ) ;
3800+ assert . equal ( q3 . no , "A.1.1" , "q3, #1" ) ;
3801+ assert . equal ( q4 . no , "A.1.2" , "q4, #1" ) ;
3802+ assert . equal ( q5 . no , "B.1" , "q5, #1" ) ;
3803+ assert . equal ( p2 . no , "B.2" , "panel2, #1" ) ;
3804+ assert . equal ( q6 . no , "B.2.1" , "q6, #1" ) ;
3805+ assert . equal ( q7 . no , "B.2.2" , "q7, #1" ) ;
3806+ } ) ;
0 commit comments