Skip to content

Commit

Permalink
work for #8129 add markup test for list-item-group
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaLarina committed May 22, 2024
1 parent 6429431 commit 0d53b95
Show file tree
Hide file tree
Showing 2 changed files with 94 additions and 2 deletions.
34 changes: 32 additions & 2 deletions tests/markup/etalon_components.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { registerMarkupTests } from "./helper";
import { Question } from "survey-core";
import { Question, Action, createDropdownActionModel } from "survey-core";

registerMarkupTests(
[
Expand Down Expand Up @@ -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"
}
]);
]);
62 changes: 62 additions & 0 deletions tests/markup/snapshots/list-component-with-subitems.snap.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
<div class="sv-popup__shadow">
<span class="sv-popup__pointer">
</span>
<div class="sv-popup__body-content">
<div class="sv-popup__scrolling-content">
<div class="sv-popup__content">
<div class="sv-list__container">
<div class="sv-list__empty-container" style="display:none;">
<div aria-label="No data to display" class="sv-list__empty-text">No data to display</div>
</div>
<ul class="sv-list" role="listbox">
<li aria-selected="false" class="sv-list__item" role="option" tabindex="0">
<div class="sv-list__item-body" style="padding-inline-start:16px;" title="text1">
<span class="sv-string-viewer">text1</span>
</div>
</li>
<li aria-selected="false" class="sv-list__item" role="option" tabindex="0">
<div class="sv-list__item-body" style="padding-inline-start:16px;" title="text2">
<span class="sv-string-viewer">text2</span>
<svg class="sv-list-item__marker-icon sv-svg-icon" role="img" style="height:16px; width:16px;">
<use xlink:href="#icon-next_16x16" class="">
</use>
</svg>
<div>
<div class="sv-popup sv-popup--dropdown sv-popup-inner" style="display:none;" tabindex="-1">
<div class="sv-popup__container">
<div class="sv-popup__shadow">
<div class="sv-popup__body-content">
<div class="sv-popup__scrolling-content">
<div class="sv-popup__content">
<div class="sv-list__container">
<div class="sv-list__empty-container" style="display:none;">
<div aria-label="No data to display" class="sv-list__empty-text">No data to display</div>
</div>
<ul class="sv-list" role="listbox">
<li aria-selected="false" class="sv-list__item" role="option" tabindex="0">
<div class="sv-list__item-body" style="padding-inline-start:16px;" title="text11">
<span class="sv-string-viewer">text11</span>
</div>
</li>
<li aria-selected="false" class="sv-list__item" role="option" tabindex="0">
<div class="sv-list__item-body" style="padding-inline-start:16px;" title="text21">
<span class="sv-string-viewer">text21</span>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>

0 comments on commit 0d53b95

Please sign in to comment.