Skip to content

Commit

Permalink
add visual test for popup into modal popup
Browse files Browse the repository at this point in the history
  • Loading branch information
OlgaLarina committed Aug 16, 2023
1 parent 3750f64 commit 2309d76
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/defaultV2-theme/defaultV2.fontless.scss
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,7 @@ body {
}
}

.sv-popup.sv-popup--dropdown.sv-single-select-list,
.sv-popup.sv-popup--dropdown {
.sv-popup.sv-popup--dropdown.sv-popup--dropdown {
.sv-popup__shadow {
box-shadow: $shadow-medium;
}
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
65 changes: 65 additions & 0 deletions visualRegressionTests/tests/defaultV2/popup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -334,4 +334,69 @@ frameworks.forEach(framework => {
await takeElementScreenshot("popup-overlay-long-list-with-title.png", null, t, comparer);
});
});

test("Popup inner modal window", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1000, 600);
await initSurvey(framework, json, { onGetQuestionTitleActions: (_, opt) => {
const json = {
elements: [
{
type: "dropdown",
name: "modal_question",
choices: [
"item1",
"item2",
"item3",
"item4",
"item5",
"item6",
"item7",
"item8",
"item9",
"item10",
"item11",
"item12",
"item13",
"item14",
"item15",
"item16",
"item17",
"item18",
"item19",
"item20",
"item21",
"item22",
"item23",
"item24",
"item25",
"item26",
"item27"
]
}
]
};
const item = new window["Survey"].Action({
component: "sv-action-bar-item",
title: "Click",
showTitle: true,
action: () => {
const model = new window["Survey"].Model(json);
model.focusFirstQuestionAutomatic = false;
window["Survey"].settings.showModal("survey", {
model: model,
survey: model
});
}
});
opt.titleActions = [item];
} });
await t
.click(clickButton.withText("Click"))
.click(Selector(".sd-dropdown"));

await resetHoverToBody(t);
await takeElementScreenshot("popup-into-modal-popup.png", Selector(".sv-popup.sv-single-select-list .sv-popup__container"), t, comparer);
});
});
});

0 comments on commit 2309d76

Please sign in to comment.