Skip to content

Commit

Permalink
work for #5484 (#5491)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitry-kurmanov authored May 15, 2024
1 parent f305683 commit ff86710
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 0 deletions.
49 changes: 49 additions & 0 deletions visualRegressionTests/tests/designer/drag-drop.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,55 @@ test("Matrix: Property Grid: Choices", async (t) => {
await takeElementScreenshot("drag-drop-matrix-pg-choices.png", Selector("[data-name=\"choices\"]"), t, comparer);
});
});

test("Matrix: Property Grid: Choices: Scroll", async (t) => {
//https://github.com/surveyjs/survey-creator/issues/5484
await wrapVisualTest(t, async (t, comparer) => {
await t.resizeWindow(1500, 500);

const patchMatrixDragDropToDisableDrop = ClientFunction(() => {
const matrix = window["creator"].designerPropertyGrid.survey.getAllQuestions().filter((q) => q.name === "choices")[0];
matrix.dragDropMatrixRows.drop = () => { };
matrix.dragDropMatrixRows.domAdapter.drop = () => { };
});

const json = {
pages: [
{
name: "page1",
elements: [
{
"type": "checkbox",
"name": "question1",
"choices": [
"Item 1",
"Item 2",
"Item 3"
]
}
]
}
]
};
await setJSON(json);

await t
.click(Selector("[data-name=\"question1\"]"), { speed: 0.5 })
.click(getPropertyGridCategory("Choice Options"));

await patchMatrixDragDropToDisableDrop();

const Item1 = Selector("[data-name=\"choices\"] [data-sv-drop-target-matrix-row]").nth(0);
const Item2 = Selector("[data-name=\"choices\"] [data-sv-drop-target-matrix-row]").nth(1);
const Item3 = Selector("[data-name=\"choices\"] [data-sv-drop-target-matrix-row]").nth(2);

let DragZoneItem2 = Selector("[data-name=\"choices\"] [data-sv-drop-target-matrix-row]").nth(1).find(".spg-drag-element__svg");
await t.dragToElement(DragZoneItem2, DragZoneItem2, { destinationOffsetX: -1, speed: 0.1 });

await takeElementScreenshot("drag-drop-matrix-pg-choices-scroll.png", Selector("[data-name=\"choices\"]"), t, comparer);
});
});

// https://github.com/surveyjs/survey-creator/issues/3113
test("Drag Drop ImagePicker (choices) drop to invalid area", async (t) => {
await wrapVisualTest(t, async (t, comparer) => {
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit ff86710

Please sign in to comment.