mirror of
https://github.com/maputnik/editor.git
synced 2026-06-18 05:07:25 +00:00
review comments
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
import { CypressHelper } from "@shellygo/cypress-test-utils";
|
import { CypressHelper } from "@shellygo/cypress-test-utils";
|
||||||
import { Assertable, then } from "@shellygo/cypress-test-utils/assertable";
|
import { Assertable, then } from "@shellygo/cypress-test-utils/assertable";
|
||||||
import MaputnikCypressHelper from "./cypress-wrapper-driver";
|
import MaputnikCypressHelper from "./maputnik-cypress-helper";
|
||||||
import ModalDriver from "./modal-driver";
|
import ModalDriver from "./modal-driver";
|
||||||
const baseUrl = "http://localhost:8888/";
|
const baseUrl = "http://localhost:8888/";
|
||||||
|
|
||||||
@@ -108,18 +108,18 @@ export class MaputnikDriver {
|
|||||||
) => {
|
) => {
|
||||||
let url = "?debug";
|
let url = "?debug";
|
||||||
switch (styleProperties) {
|
switch (styleProperties) {
|
||||||
case "geojson":
|
case "geojson":
|
||||||
url += `&style=${baseUrl}geojson-style.json`;
|
url += `&style=${baseUrl}geojson-style.json`;
|
||||||
break;
|
break;
|
||||||
case "raster":
|
case "raster":
|
||||||
url += `&style=${baseUrl}raster-style.json`;
|
url += `&style=${baseUrl}raster-style.json`;
|
||||||
break;
|
break;
|
||||||
case "both":
|
case "both":
|
||||||
url += `&style=${baseUrl}geojson-raster-style.json`;
|
url += `&style=${baseUrl}geojson-raster-style.json`;
|
||||||
break;
|
break;
|
||||||
case "layer":
|
case "layer":
|
||||||
url += `&style=${baseUrl}/example-layer-style.json`;
|
url += `&style=${baseUrl}/example-layer-style.json`;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (zoom) {
|
if (zoom) {
|
||||||
url += `#${zoom}/41.3805/2.1635`;
|
url += `#${zoom}/41.3805/2.1635`;
|
||||||
@@ -169,13 +169,6 @@ export class MaputnikDriver {
|
|||||||
styleFromLocalStorage: () =>
|
styleFromLocalStorage: () =>
|
||||||
this.helper.get.window().then((win) => styleFromWindow(win)),
|
this.helper.get.window().then((win) => styleFromWindow(win)),
|
||||||
|
|
||||||
maputnikStyleFromLocalStorageObj: () => {
|
|
||||||
const styleId = localStorage.getItem("maputnik:latest_style");
|
|
||||||
const styleItem = localStorage.getItem(`maputnik:style:${styleId}`);
|
|
||||||
const obj = JSON.parse(styleItem || "");
|
|
||||||
return obj;
|
|
||||||
},
|
|
||||||
|
|
||||||
exampleFileUrl: () => {
|
exampleFileUrl: () => {
|
||||||
return baseUrl + "example-style.json";
|
return baseUrl + "example-style.json";
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { v1 as uuid } from "uuid";
|
import { v1 as uuid } from "uuid";
|
||||||
import MaputnikCypressHelper from "./cypress-wrapper-driver";
|
import MaputnikCypressHelper from "./maputnik-cypress-helper";
|
||||||
|
|
||||||
export default class ModalDriver {
|
export default class ModalDriver {
|
||||||
private helper = new MaputnikCypressHelper();
|
private helper = new MaputnikCypressHelper();
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ describe("modals", () => {
|
|||||||
beforeAndAfter();
|
beforeAndAfter();
|
||||||
|
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
when.visit("/");
|
when.setStyle("");
|
||||||
});
|
});
|
||||||
describe("open", () => {
|
describe("open", () => {
|
||||||
beforeEach(() => {
|
beforeEach(() => {
|
||||||
@@ -51,7 +51,7 @@ describe("modals", () => {
|
|||||||
when.click("nav:export");
|
when.click("nav:export");
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip("close", () => {
|
it("close", () => {
|
||||||
when.modal.close("modal:export");
|
when.modal.close("modal:export");
|
||||||
then(get.elementByTestId("modal:export")).shouldNotExist();
|
then(get.elementByTestId("modal:export")).shouldNotExist();
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user