From a9c3da0f404b3075c5366ba54d9bc3c83ca9b12a Mon Sep 17 00:00:00 2001 From: HarelM Date: Thu, 9 Jul 2026 13:59:55 +0300 Subject: [PATCH] Remove hack from modal driver --- e2e/layers-list.spec.ts | 5 ++--- e2e/modal-driver.ts | 4 ---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/e2e/layers-list.spec.ts b/e2e/layers-list.spec.ts index 68d80735..58ddc0e1 100644 --- a/e2e/layers-list.spec.ts +++ b/e2e/layers-list.spec.ts @@ -121,7 +121,6 @@ describe("layers list", () => { }); test("groups", async () => { - await when.modal.open(); const id1 = await when.modal.fillLayers({ id: "aa", type: "line", layer: "example" }); await when.modal.open(); @@ -310,7 +309,6 @@ describe("layers list", () => { describe("drag and drop", () => { test("move layer should update local storage", async () => { - await when.modal.open(); const firstId = await when.modal.fillLayers({ id: "a", type: "background" }); await when.modal.open(); const secondId = await when.modal.fillLayers({ id: "b", type: "background" }); @@ -333,7 +331,8 @@ describe("layers list", () => { test("should keep header visible when scrolling layer list", async () => { // Setup: Create multiple layers to enable scrolling for (let i = 0; i < 20; i++) { - await when.modal.open(); + // The modal is already open (beforeEach) for the first layer. + if (i > 0) await when.modal.open(); await when.modal.fillLayers({ id: `layer-${i}`, type: "background" }); } diff --git a/e2e/modal-driver.ts b/e2e/modal-driver.ts index 47d0f9e4..aa567299 100644 --- a/e2e/modal-driver.ts +++ b/e2e/modal-driver.ts @@ -31,10 +31,6 @@ export class ModalDriver { }, open: async () => { - // No-op when the add-layer modal is already open (some specs call open() - // both in a beforeEach and at the start of the test body). - const modal = this.driver.get.elementByTestId("modal:add-layer").first(); - if (await modal.isVisible()) return; await this.driver.when.click("layer-list:add-layer"); },