@@ -2285,6 +2285,49 @@ QUnit.test("singleInput navigattion & errors for nested matrix #4, Bug#9982", as
2285
2285
assert . equal ( matrix . singleInputQuestion . name , "employee-name" , "singleInputQuestion is employee-name, #5" ) ;
2286
2286
assert . equal ( matrix . singleInputQuestion . errors . length , 1 , "singleInputQuestion show errors, #5" ) ;
2287
2287
} ) ;
2288
+ QUnit . test ( "singleInput visibleIf in the container in dynamic panel, Bug#10360" , assert => {
2289
+ const survey = new SurveyModel ( {
2290
+ elements : [
2291
+ { type : "paneldynamic" , name : "panel" , panelCount : 2 , templateElements : [
2292
+ { type : "text" , name : "q1" , isRequired : true , defaultValue : "a" } ,
2293
+ { type : "panel" , name : "p1" , visibleIf : "{panel.q1} = 'a'" ,
2294
+ elements : [ { type : "text" , name : "q2" , isRequired : true } ]
2295
+ }
2296
+ ]
2297
+ }
2298
+ ] ,
2299
+ questionsOnPageMode : "inputPerPage"
2300
+ } ) ;
2301
+ const panel = < QuestionPanelDynamicModel > survey . getQuestionByName ( "panel" ) ;
2302
+ assert . equal ( survey . currentSingleQuestion . name , "panel" , "currentSingleQuestion is panel, #1" ) ;
2303
+ assert . equal ( panel . singleInputQuestion . name , "q1" , "singleInputQuestion is q1, #1" ) ;
2304
+ survey . performNext ( ) ;
2305
+ assert . equal ( panel . singleInputQuestion . name , "q2" , "singleInputQuestion is q2, #2" ) ;
2306
+ survey . performPrevious ( ) ;
2307
+ assert . equal ( panel . singleInputQuestion . name , "q1" , "singleInputQuestion is q1, #3" ) ;
2308
+ assert . equal ( panel . panels [ 0 ] . getElementByName ( "p1" ) . isVisible , true , "p1 is visible, #3" ) ;
2309
+ panel . singleInputQuestion . value = "b" ;
2310
+ assert . equal ( panel . panels [ 0 ] . getElementByName ( "p1" ) . isVisible , false , "p1 is not visible, #4" ) ;
2311
+ assert . equal ( panel . panels [ 0 ] . getQuestionByName ( "q2" ) . isVisibleInSurvey , false , "q2 is not visible, #4" ) ;
2312
+ survey . performNext ( ) ;
2313
+ assert . equal ( panel . singleInputQuestion . name , "q1" , "singleInputQuestion is q1, #4" ) ;
2314
+ survey . performNext ( ) ;
2315
+ assert . equal ( panel . singleInputQuestion . name , "q2" , "singleInputQuestion is q2, #5" ) ;
2316
+ panel . singleInputQuestion . value = "val1" ;
2317
+ survey . performNext ( ) ;
2318
+ assert . equal ( panel . singleInputQuestion . name , "panel" , "singleInputQuestion is panel - summary, #6" ) ;
2319
+ panel . singleInputSummary ?. items [ 1 ] . btnEdit . action ( ) ;
2320
+ assert . equal ( panel . singleInputQuestion . name , "q1" , "singleInputQuestion is q1, #7" ) ;
2321
+ panel . singleInputQuestion . value = "b" ;
2322
+ survey . performNext ( ) ;
2323
+ assert . equal ( panel . singleInputQuestion . name , "panel" , "singleInputQuestion is panel, #8" ) ;
2324
+ panel . singleInputSummary ?. items [ 1 ] . btnEdit . action ( ) ;
2325
+ assert . equal ( panel . singleInputQuestion . name , "q1" , "singleInputQuestion is q1, #9" ) ;
2326
+ panel . singleInputQuestion . value = "a" ;
2327
+ survey . performNext ( ) ;
2328
+ assert . equal ( panel . singleInputQuestion . name , "q2" , "singleInputQuestion is q2, #10" ) ;
2329
+ } ) ;
2330
+
2288
2331
//TODO re-think this test. We need to include summaries into brasdscrum navigation
2289
2332
QUnit . skip ( "singleInput bradscrum navigation for 3 level dynamic panels" , assert => {
2290
2333
const survey = new SurveyModel ( {
0 commit comments