Remove hack from modal driver

This commit is contained in:
HarelM
2026-07-09 13:59:55 +03:00
parent dc5d6dd77d
commit a9c3da0f40
2 changed files with 2 additions and 7 deletions
+2 -3
View File
@@ -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" });
}
-4
View File
@@ -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");
},