Skip to content

Commit

Permalink
specify drag positions
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Aug 4, 2024
1 parent 9bfb077 commit 692bc48
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/static/tests/e2e/code.etest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,11 @@ test.describe("Code Tab tests", () => {

// Drag variable to second graph
const sVariable = await page.locator(":nth-match(.graph-config-panel .variable, 1)");
await sVariable.dragTo(page.locator(":nth-match(.graph-config-panel .drop-zone, 2)"));
const dragPositions = {
sourcePosition: { x: 5, y: 5 },
targetPosition: { x: 5, y: 5 }
};
await sVariable.dragTo(page.locator(":nth-match(.graph-config-panel .drop-zone, 2)"), dragPositions );

await expectGraphVariables(page, 0, ["I", "R"]);
await expectGraphVariables(page, 1, ["S"]);
Expand All @@ -335,9 +339,9 @@ test.describe("Code Tab tests", () => {
// Drag a variable with Ctrl key to make copy
const iVariable = await page.locator(":nth-match(.graph-config-panel .variable, 1)");
await page.keyboard.down("Control");
await iVariable.dragTo(page.locator(":nth-match(.graph-config-panel .drop-zone, 2)"));
await iVariable.dragTo(page.locator(":nth-match(.graph-config-panel .drop-zone, 2)"), dragPositions);
await page.keyboard.up("Control");
await expectGraphVariables(page, 0, ["R"]);
await expectGraphVariables(page, 0, ["I", "R"]);
await expectGraphVariables(page, 1, ["S", "I"]);

// Delete second graph
Expand Down

0 comments on commit 692bc48

Please sign in to comment.