mirror of
https://github.com/maputnik/editor.git
synced 2026-07-27 08:17:26 +00:00
Remove hack from modal driver
This commit is contained in:
@@ -121,7 +121,6 @@ describe("layers list", () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
test("groups", async () => {
|
test("groups", async () => {
|
||||||
await when.modal.open();
|
|
||||||
const id1 = await when.modal.fillLayers({ id: "aa", type: "line", layer: "example" });
|
const id1 = await when.modal.fillLayers({ id: "aa", type: "line", layer: "example" });
|
||||||
|
|
||||||
await when.modal.open();
|
await when.modal.open();
|
||||||
@@ -310,7 +309,6 @@ describe("layers list", () => {
|
|||||||
|
|
||||||
describe("drag and drop", () => {
|
describe("drag and drop", () => {
|
||||||
test("move layer should update local storage", async () => {
|
test("move layer should update local storage", async () => {
|
||||||
await when.modal.open();
|
|
||||||
const firstId = await when.modal.fillLayers({ id: "a", type: "background" });
|
const firstId = await when.modal.fillLayers({ id: "a", type: "background" });
|
||||||
await when.modal.open();
|
await when.modal.open();
|
||||||
const secondId = await when.modal.fillLayers({ id: "b", type: "background" });
|
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 () => {
|
test("should keep header visible when scrolling layer list", async () => {
|
||||||
// Setup: Create multiple layers to enable scrolling
|
// Setup: Create multiple layers to enable scrolling
|
||||||
for (let i = 0; i < 20; i++) {
|
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" });
|
await when.modal.fillLayers({ id: `layer-${i}`, type: "background" });
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -31,10 +31,6 @@ export class ModalDriver {
|
|||||||
},
|
},
|
||||||
|
|
||||||
open: async () => {
|
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");
|
await this.driver.when.click("layer-list:add-layer");
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user