mirror of
https://github.com/maputnik/editor.git
synced 2026-02-06 04:30:01 +00:00
remove left overs
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { CypressHelper } from "@shellygo/cypress-test-utils";
|
||||
|
||||
export default class CypressWrapperDriver {
|
||||
export default class MaputnikCypressHelper {
|
||||
private helper = new CypressHelper({ defaultDataAttribute: "data-wd-key" });
|
||||
|
||||
public given = {
|
||||
@@ -13,9 +13,6 @@ export default class CypressWrapperDriver {
|
||||
|
||||
public when = {
|
||||
...this.helper.when,
|
||||
confirmAlert() {
|
||||
cy.on("window:confirm", () => true);
|
||||
},
|
||||
};
|
||||
|
||||
public beforeAndAfter = this.helper.beforeAndAfter;
|
||||
|
||||
@@ -2,7 +2,7 @@ import { v1 as uuid } from "uuid";
|
||||
import { MaputnikDriver } from "./maputnik-driver";
|
||||
|
||||
describe("layers", () => {
|
||||
let { beforeAndAfter, get, when, should, then } = new MaputnikDriver();
|
||||
let { beforeAndAfter, get, when, then } = new MaputnikDriver();
|
||||
beforeAndAfter();
|
||||
beforeEach(() => {
|
||||
when.setStyle("both");
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CypressHelper } from "@shellygo/cypress-test-utils";
|
||||
import { Assertable, then } from "@shellygo/cypress-test-utils/assertable";
|
||||
import CypressWrapperDriver from "./cypress-wrapper-driver";
|
||||
import MaputnikCypressHelper from "./cypress-wrapper-driver";
|
||||
import ModalDriver from "./modal-driver";
|
||||
const baseUrl = "http://localhost:8888/";
|
||||
|
||||
@@ -22,7 +22,7 @@ export class MaputnikAssertable<T> extends Assertable<T> {
|
||||
}
|
||||
|
||||
export class MaputnikDriver {
|
||||
private helper = new CypressWrapperDriver();
|
||||
private helper = new MaputnikCypressHelper();
|
||||
private modalDriver = new ModalDriver();
|
||||
|
||||
public beforeAndAfter = () => {
|
||||
@@ -126,7 +126,7 @@ export class MaputnikDriver {
|
||||
}
|
||||
this.helper.when.visit(baseUrl + url);
|
||||
if (styleProperties) {
|
||||
this.helper.when.confirmAlert();
|
||||
this.helper.when.acceptConfirm();
|
||||
}
|
||||
// when methods should not include assertions
|
||||
this.helper.get.elementByTestId("toolbar:link").should("be.visible");
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
import { v1 as uuid } from "uuid";
|
||||
import CypressWrapperDriver from "./cypress-wrapper-driver";
|
||||
import MaputnikCypressHelper from "./cypress-wrapper-driver";
|
||||
|
||||
export default class ModalDriver {
|
||||
private helper = new CypressWrapperDriver();
|
||||
private helper = new MaputnikCypressHelper();
|
||||
|
||||
public when = {
|
||||
fillLayers: (opts: { type: string; layer?: string; id?: string }) => {
|
||||
// Having logic in test code is an anti pattern.
|
||||
// This should be splitted to multiple single responsibility functions
|
||||
let type = opts.type;
|
||||
let layer = opts.layer;
|
||||
let id;
|
||||
|
||||
Reference in New Issue
Block a user