@eox/layercontrol 0.13.0 → 0.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -19,7 +19,7 @@ const disableDrag = () => {
|
|
|
19
19
|
cy.get(".tools summary").click({ multiple: true });
|
|
20
20
|
|
|
21
21
|
// Verifying the visibility of the drag handle
|
|
22
|
-
cy.get(".drag-handle
|
|
22
|
+
cy.get(".drag-handle.disabled").should("have.length", 1);
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
const DUMMY_API_RESPONSE = [
|
|
2
|
+
"GET",
|
|
3
|
+
"https://ows.mundialis.de/services/service?SERVICE=WMS&REQUEST=GetCapabilities",
|
|
4
|
+
{
|
|
5
|
+
statusCode: 200,
|
|
6
|
+
headers: { "Content-Type": "application/vnd.ogc.wms_xml" },
|
|
7
|
+
body: `<?xml version="1.0"?> <WMT_MS_Capabilities version="1.1.1"> <Capability> <Layer queryable="1"> <Title>OpenStreetMap WMS</Title> <Layer queryable="1"> <Name>bar</Name> </Layer> </Layer> </Capability> </WMT_MS_Capabilities>`,
|
|
8
|
+
},
|
|
9
|
+
];
|
|
10
|
+
|
|
11
|
+
const DUMMY_JSON = `{ type: "Tile", properties: { id: "baz", title: "baz" }}`;
|
|
12
|
+
|
|
1
13
|
const addExternalLayers = () => {
|
|
2
14
|
// Set up a mock map with a layer "foo"
|
|
3
15
|
cy.get("mock-map").and(($el) => {
|
|
@@ -6,6 +18,9 @@ const addExternalLayers = () => {
|
|
|
6
18
|
|
|
7
19
|
let mapTile = "";
|
|
8
20
|
|
|
21
|
+
// Intercept API Response So that API don't fail
|
|
22
|
+
cy.intercept(...DUMMY_API_RESPONSE).as("getDummyXml");
|
|
23
|
+
|
|
9
24
|
// Add a new layer via the layer control UI
|
|
10
25
|
cy.get("eox-layercontrol")
|
|
11
26
|
.shadow()
|
|
@@ -17,7 +32,9 @@ const addExternalLayers = () => {
|
|
|
17
32
|
cy.get(".eox-add").should("have.class", "open");
|
|
18
33
|
|
|
19
34
|
// Input the URL to fetch layers and select the first layer in the list
|
|
20
|
-
cy.get(".add-url").type("https://ows.mundialis.de/services/service"
|
|
35
|
+
cy.get(".add-url").type("https://ows.mundialis.de/services/service", {
|
|
36
|
+
force: true,
|
|
37
|
+
});
|
|
21
38
|
cy.get(".search-icon").as("apibtn").click();
|
|
22
39
|
cy.get("@apibtn").should("not.be.disabled");
|
|
23
40
|
|
|
@@ -30,14 +47,21 @@ const addExternalLayers = () => {
|
|
|
30
47
|
mapTile = text.trim();
|
|
31
48
|
});
|
|
32
49
|
});
|
|
33
|
-
})
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
50
|
+
})
|
|
51
|
+
.then(() => {
|
|
52
|
+
cy.wait("@getDummyXml")
|
|
53
|
+
.its("response")
|
|
54
|
+
.then(() => {
|
|
55
|
+
// Verify if the added layer is displayed in the layer control list
|
|
56
|
+
cy.get("eox-layercontrol")
|
|
57
|
+
.shadow()
|
|
58
|
+
.find("eox-layercontrol-layer-list")
|
|
59
|
+
.then(($el) => {
|
|
60
|
+
cy.wrap($el).first(() => {
|
|
61
|
+
cy.get("li").should("have.attr", "data-layer", mapTile);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
});
|
|
41
65
|
});
|
|
42
66
|
|
|
43
67
|
// Add another layer using a JSON configuration
|
|
@@ -48,20 +72,24 @@ const addExternalLayers = () => {
|
|
|
48
72
|
cy.wrap($el).within(() => {
|
|
49
73
|
// Switch to the JSON tab and input the layer configuration
|
|
50
74
|
cy.get(".eox-add-layer-tab li").last().click();
|
|
51
|
-
cy.get("textarea").type(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
);
|
|
55
|
-
cy.get(".json-add-layer").click();
|
|
75
|
+
cy.get("textarea").type(DUMMY_JSON, {
|
|
76
|
+
parseSpecialCharSequences: false,
|
|
77
|
+
force: true,
|
|
78
|
+
});
|
|
79
|
+
cy.get(".json-add-layer").as("jsonbtn").click();
|
|
80
|
+
cy.get("@jsonbtn").should("be.disabled");
|
|
56
81
|
});
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
82
|
+
})
|
|
83
|
+
.then(() => {
|
|
84
|
+
// Verify if the second layer is displayed in the layer control list
|
|
85
|
+
cy.get("eox-layercontrol")
|
|
86
|
+
.shadow()
|
|
87
|
+
.find("eox-layercontrol-layer-list")
|
|
88
|
+
.then(($el) => {
|
|
89
|
+
cy.wrap($el).first(() => {
|
|
90
|
+
cy.get("li").should("have.attr", "data-layer", "baz");
|
|
91
|
+
});
|
|
92
|
+
});
|
|
65
93
|
});
|
|
66
94
|
};
|
|
67
95
|
|