| 
1 | 1 | import { QuestionAdornerViewModel } from "../src/components/question";  | 
2 |  | -import { Action, ComponentCollection, PopupDropdownViewModel, QuestionPanelDynamicModel, QuestionRadiogroupModel, settings, SurveyElement, SurveyModel, settings as surveySettings } from "survey-core";  | 
 | 2 | +import { Action, ComponentCollection, PopupDropdownViewModel, QuestionPanelDynamicModel, QuestionRadiogroupModel, QuestionTextModel, settings, SurveyElement, SurveyModel, settings as surveySettings } from "survey-core";  | 
3 | 3 | import { CreatorTester } from "./creator-tester";  | 
4 | 4 | import { PageAdorner } from "../src/components/page";  | 
5 | 5 | import { TabDesignerPlugin } from "../src/components/tabs/designer-plugin";  | 
@@ -929,6 +929,34 @@ test("Check question converter with subitems (types)", (): any => {  | 
929 | 929 |   surveySettings.animationEnabled = true;  | 
930 | 930 | });  | 
931 | 931 | 
 
  | 
 | 932 | +test("Check question converter on subitem search", (): any => {  | 
 | 933 | +  surveySettings.animationEnabled = false;  | 
 | 934 | +  const creator = new CreatorTester();  | 
 | 935 | + | 
 | 936 | +  creator.JSON = {  | 
 | 937 | +    elements: [  | 
 | 938 | +      { type: "text", name: "q1" },  | 
 | 939 | +    ]  | 
 | 940 | +  };  | 
 | 941 | +  const question = creator.survey.getQuestionByName("q1");  | 
 | 942 | +  creator.selectElement(question);  | 
 | 943 | +  const questionAdorner = new QuestionAdornerViewModel(  | 
 | 944 | +    creator,  | 
 | 945 | +    question,  | 
 | 946 | +    <any>undefined  | 
 | 947 | +  );  | 
 | 948 | + | 
 | 949 | +  const list = getQuestionConverterList(creator, "q1");  | 
 | 950 | +  list.filterString = "Email";  | 
 | 951 | +  const filteredActions = list.renderedActions.filter(item => list.isItemVisible(item));  | 
 | 952 | +  expect(filteredActions).toHaveLength(1);  | 
 | 953 | +  filteredActions[0].action();  | 
 | 954 | +  const questionConverted = creator.survey.getQuestionByName("q1") as QuestionTextModel;  | 
 | 955 | +  expect(questionConverted.inputType).toBe("email");  | 
 | 956 | + | 
 | 957 | +  surveySettings.animationEnabled = true;  | 
 | 958 | +});  | 
 | 959 | + | 
932 | 960 | test("Check question converter with single subitem (json)", (): any => {  | 
933 | 961 |   surveySettings.animationEnabled = false;  | 
934 | 962 |   const creator = new CreatorTester();  | 
 | 
0 commit comments