Skip to content

Commit

Permalink
work for #8129 Popup submenu - f-test
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaLarina committed May 28, 2024
1 parent c99d4b4 commit 35077c0
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 28 deletions.
3 changes: 0 additions & 3 deletions src/default-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1138,9 +1138,6 @@ sv-popup {
.sv-popup.sv-popup-inner {
height: 0;
}
.sv-popup-inner .sv-popup__container {
margin-top: calc(-1 * var(--base-unit, 8px));
}

.sv-popup__container {
box-shadow: 0px 2px 6px rgba(0, 0, 0, 0.1);
Expand Down
44 changes: 19 additions & 25 deletions testCafe/components/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ frameworks.forEach(async framework => {
});

test("not hide modal popup after scroll", async t => {
let choices:Array<string> = [];
let choices: Array<string> = [];
for (let index = 0; index < 50; index++) {
choices[index] = "item" + index;
}
Expand Down Expand Up @@ -366,7 +366,7 @@ frameworks.forEach(async framework => {
});
test("check popup with filter", async t => {
const currentAddDropdownTitleAction = (_, opt) => {
if(opt.question.name !== "actions_question") return;
if (opt.question.name !== "actions_question") return;

let items: Array<any> = [];
for (let index = 0; index < 20; index++) {
Expand Down Expand Up @@ -418,20 +418,22 @@ frameworks.forEach(async framework => {
});

test("list model", async t => {
await initSurvey(framework, json, { onGetQuestionTitleActions: (_, opt) => {
const getItems = (count, startIndex = 0) => {
await initSurvey(framework, json, {
onGetQuestionTitleActions: (_, opt) => {
const getItems = (count, startIndex = 0) => {
const list: Array<any> = [];
for (let index = startIndex; index < count; index++) {
list[index - startIndex] = new window["Survey"].Action({ id: index, title: "item" + index, needSeparator: index % 4 == 1 });
}
return list;
};
const dropdownWithSearchAction = window["Survey"].createDropdownActionModel(
{ title: "Long List", showTitle: true },
{ items: getItems(40), showPointer: true }
);
opt.titleActions = [dropdownWithSearchAction];
} });
for (let index = startIndex; index < count; index++) {
list[index - startIndex] = new window["Survey"].Action({ id: index, title: "item" + index, needSeparator: index % 4 == 1 });
}
return list;
};
const dropdownWithSearchAction = window["Survey"].createDropdownActionModel(
{ title: "Long List", showTitle: true },
{ items: getItems(40), showPointer: true }
);
opt.titleActions = [dropdownWithSearchAction];
}
});

const listItems = Selector(".sv-list__item").filterVisible();

Expand Down Expand Up @@ -493,23 +495,15 @@ frameworks.forEach(async framework => {
.expect(item5Subitems.visible).ok()
.expect(item6Subitems.visible).notOk()

.click(getListItemByText("inner item1")) // click 'inner item1'
.wait(300)
.debug()
.expect(titlePopup.visible).notOk()
.expect(item5Subitems.visible).notOk()
.expect(item6Subitems.visible).notOk()

.click(Selector(".sv-action-bar-item")) // show action popup
.expect(getListItemByText("inner item1").count).eql(2)
.click(getListItemByText("inner item1").nth(1)) // click 'inner item1'
.wait(300)
.debug()
.expect(titlePopup.visible).ok()
.expect(item5Subitems.visible).notOk()
.expect(item6Subitems.visible).notOk()

.click(item6) // click 'item6 has items'
.wait(300)
.debug()
.expect(titlePopup.visible).notOk()
.expect(item5Subitems.visible).notOk()
.expect(item6Subitems.visible).notOk();
Expand Down

0 comments on commit 35077c0

Please sign in to comment.