@@ -237,8 +237,10 @@ test("dropdown property editor, get choices on callback", () => {
237
237
Serializer . removeProperty ( "survey" , "region" ) ;
238
238
} ) ;
239
239
test ( "Serializer.addpropery, type: 'dropdown' cuts the text before dots, provided into choices. Bug#5787" , ( ) : any => {
240
- Serializer . addProperty ( "survey" , { name : "prop1:dropdown" , type : "dropdown" ,
241
- choices : [ "Gemini 1.5 Pro" , "Claude 3.5 Sonnet" ] } ) ;
240
+ Serializer . addProperty ( "survey" , {
241
+ name : "prop1:dropdown" , type : "dropdown" ,
242
+ choices : [ "Gemini 1.5 Pro" , "Claude 3.5 Sonnet" ]
243
+ } ) ;
242
244
const survey = new SurveyModel ( ) ;
243
245
const propertyGrid = new PropertyGridModelTester ( survey ) ;
244
246
const question = propertyGrid . survey . getQuestionByName ( "prop1" ) ;
@@ -3324,6 +3326,47 @@ test("check pages editor respects onPageAdding", () => {
3324
3326
expect ( creator . survey . pages . length ) . toBe ( 1 ) ;
3325
3327
settings . defaultNewSurveyJSON = savedNewJSON ;
3326
3328
} ) ;
3329
+ test ( "Localication and survey.pages property, Bug#6687" , ( ) => {
3330
+ const deutschStrings : any = {
3331
+ ed : {
3332
+ newPageName : "Seite"
3333
+ }
3334
+ } ;
3335
+ editorLocalization . locales [ "de" ] = deutschStrings ;
3336
+ const creator = new CreatorTester ( ) ;
3337
+ creator . locale = "de" ;
3338
+ creator . JSON = { } ;
3339
+ const propertyGrid = new PropertyGridModelTester ( creator . survey ) ;
3340
+ const pagesQuestion = < QuestionMatrixDynamicModel > (
3341
+ propertyGrid . survey . getQuestionByName ( "pages" )
3342
+ ) ;
3343
+ const propertyEditor = new PropertyGridEditorMatrixPages ( ) ;
3344
+ const options = { titleActions : [ ] , question : pagesQuestion } ;
3345
+ propertyEditor . onGetQuestionTitleActions ( creator . survey , options , creator ) ;
3346
+ const addNewPageAction = options . titleActions [ 0 ] as IAction ;
3347
+
3348
+ expect ( creator . survey . pages . length ) . toBe ( 0 ) ;
3349
+ addNewPageAction . action ! ( ) ;
3350
+
3351
+ expect ( creator . survey . pages . length ) . toBe ( 1 ) ;
3352
+ expect ( creator . survey . pages [ 0 ] . name ) . toBe ( "Seite1" ) ;
3353
+ } ) ;
3354
+ test ( "panellayoutcolumns doesn't have adding button" , ( ) => {
3355
+ const creator = new CreatorTester ( ) ;
3356
+ creator . JSON = {
3357
+ gridLayoutEnabled : true ,
3358
+ elements : [ { type : "text" , name : "q1" } ]
3359
+ } ;
3360
+ const propertyGrid = new PropertyGridModelTester ( creator . survey . pages [ 0 ] ) ;
3361
+ const gridColumnsQuestion = < QuestionMatrixDynamicModel > ( propertyGrid . survey . getQuestionByName ( "gridLayoutColumns" ) ) ;
3362
+ expect ( gridColumnsQuestion ) . toBeTruthy ( ) ;
3363
+ expect ( gridColumnsQuestion . allowAddRows ) . toBeFalsy ( ) ;
3364
+ expect ( gridColumnsQuestion . getTitleToolbar ( ) ) . toBeTruthy ( ) ;
3365
+ const helpButton = gridColumnsQuestion . titleActions . find ( a => a . id === "property-grid-help" ) ;
3366
+ const addButton = gridColumnsQuestion . titleActions . find ( a => a . id === "add-item" ) ;
3367
+ expect ( helpButton ) . toBeTruthy ( ) ;
3368
+ expect ( addButton ) . toBeFalsy ( ) ;
3369
+ } ) ;
3327
3370
test ( "Set property name into correct category" , ( ) => {
3328
3371
Serializer . addProperty ( "question" , {
3329
3372
name : "validation" ,
0 commit comments