|
3 | 3 | QuestionMatrixModel, QuestionMultipleTextModel, QuestionRatingModel, QuestionTextModel, QuestionBooleanModel, Serializer, SurveyModel,
|
4 | 4 | SurveyTriggerRunExpression, UrlConditionItem, settings as surveySettings,
|
5 | 5 | ItemValue,
|
6 |
| - QuestionCheckboxModel |
| 6 | + QuestionCheckboxModel, |
| 7 | + QuestionImagePickerModel |
7 | 8 | } from "survey-core";
|
8 | 9 | import { PropertyGridModelTester } from "./property-grid.base";
|
9 | 10 | import { PropertyGridEditorMatrixMutlipleTextItems } from "../../src/property-grid/matrices";
|
@@ -470,6 +471,24 @@ test("QuestionCheckbox choices placeholder", () => {
|
470 | 471 | row.getQuestionByName("value").value = "item111";
|
471 | 472 | expect(row.getQuestionByName("text").placeholder).toBe("item111");
|
472 | 473 | });
|
| 474 | +test("ImagePicker choices columns & detail panel", () => { |
| 475 | + const question = new QuestionImagePickerModel("q1"); |
| 476 | + question.choices = ["item1"]; |
| 477 | + var propertyGrid = new PropertyGridModelTester(question); |
| 478 | + var choicesQuestion = <QuestionMatrixDynamicModel>( |
| 479 | + propertyGrid.survey.getQuestionByName("choices") |
| 480 | + ); |
| 481 | + expect(choicesQuestion).toBeTruthy(); |
| 482 | + expect(choicesQuestion.columns).toHaveLength(3); |
| 483 | + expect(choicesQuestion.columns[0].name).toBe("value"); |
| 484 | + expect(choicesQuestion.columns[1].name).toBe("text"); |
| 485 | + expect(choicesQuestion.columns[2].name).toBe("imageLink"); |
| 486 | + const row = choicesQuestion.visibleRows[0]; |
| 487 | + row.showDetailPanel(); |
| 488 | + expect(row.detailPanel.questions).toHaveLength(5); |
| 489 | + const imageLinkQuestion = row.detailPanel.getQuestionByName("imageLink"); |
| 490 | + expect(imageLinkQuestion).toBeTruthy(); |
| 491 | +}); |
473 | 492 | test("Triggers property editor, Bug #4454", () => {
|
474 | 493 | var survey = new SurveyModel();
|
475 | 494 | const completeTrigger = new SurveyTriggerComplete();
|
|
0 commit comments