diff --git a/tests/markup/etalon_components.ts b/tests/markup/etalon_components.ts index 9111cdb848..83fb985a77 100644 --- a/tests/markup/etalon_components.ts +++ b/tests/markup/etalon_components.ts @@ -1,5 +1,5 @@ import { registerMarkupTests } from "./helper"; -import { Question } from "survey-core"; +import { Question, Action, createDropdownActionModel } from "survey-core"; registerMarkupTests( [ @@ -29,5 +29,35 @@ registerMarkupTests( return document.querySelector(".sv-popup.sv-dropdown-popup .sv-popup__container") as HTMLElement; }, snapshot: "list-component" + // }, { + // name: "Test popup list with subitems", + // json: { + // questions: [ + // { + // "type": "text", + // "name": "q1", + // "title": "Question title" + // } + // ] + // }, + // before: () => { Question["questionCounter"] = 100; }, + // initSurvey: (survey) => { + // survey.onGetQuestionTitleActions.add((_, opt) => { + // const items = [new Action({ id: "1", title: "text1" }), new Action({ id: "2", title: "text2" })]; + // const item = createDropdownActionModel( + // { title: "bottom", showTitle: true }, + // { + // verticalPosition: "bottom", horizontalPosition: "center", items: items, + // onSelectionChanged: (item, ...params) => { } + // }); + // items[1].setItems([{ id: "11", title: "text11" }, { id: "21", title: "text21" }], () => { }); + // opt.titleActions = [item]; + // }); + // }, + // getElement: () => { + // return document.querySelector(".sv-popup .sv-popup__container") as HTMLElement; + // }, + // event: "onAfterRenderSurvey", + // snapshot: "list-component-with-subitems" } - ]); \ No newline at end of file + ]); diff --git a/tests/markup/snapshots/list-component-with-subitems.snap.html b/tests/markup/snapshots/list-component-with-subitems.snap.html new file mode 100644 index 0000000000..48a67c636e --- /dev/null +++ b/tests/markup/snapshots/list-component-with-subitems.snap.html @@ -0,0 +1,62 @@ +
+ + +
+
+
+
+ +
    +
  • +
    + text1 +
    +
  • +
  • +
    + text2 + + + + +
    + +
    +
    +
  • +
+
+
+
+
+
\ No newline at end of file