Version 1.0.4.1 open Links in new Tab for polylines and devices work it without disablePolylineEvents(window.polylines);
This commit is contained in:
46
cypress/e2e/spec.cy.js
Normal file
46
cypress/e2e/spec.cy.js
Normal file
@@ -0,0 +1,46 @@
|
||||
describe("Map Initial Load Test", () => {
|
||||
it("should load the map with the correct center and zoom", () => {
|
||||
// Besuche die Seite, auf der die Karte angezeigt wird
|
||||
cy.visit("http://192.168.10.167:3000/?m=12&u=485");
|
||||
|
||||
// Überprüfe, ob das Kartenelement existiert
|
||||
cy.get("#map").should("be.visible");
|
||||
|
||||
// Überprüfe, ob die Karte das korrekte Zentrum und den korrekten Zoom hat
|
||||
cy.window().then((win) => {
|
||||
const map = win.L.map;
|
||||
const center = map.getCenter();
|
||||
const zoom = map.getZoom();
|
||||
|
||||
expect(center.lat).to.be.closeTo(53.111111, 0.0001);
|
||||
expect(center.lng).to.be.closeTo(8.4625, 0.0001);
|
||||
expect(zoom).to.eq(12);
|
||||
});
|
||||
});
|
||||
});
|
||||
describe("Map Context Menu Test", () => {
|
||||
it("should show context menu on right click", () => {
|
||||
cy.visit("http://192.168.10.167:3000/?m=12&u=485");
|
||||
|
||||
// Rechte Maustaste auf eine Koordinate in der Karte klicken
|
||||
cy.get("#map").rightclick(400, 300); // Rechtsklick auf eine Position in der Karte
|
||||
|
||||
// Überprüfen, ob das Kontextmenü angezeigt wird
|
||||
cy.contains("Station öffnen (Tab)").should("be.visible");
|
||||
});
|
||||
|
||||
it("should open a new tab when context menu option is clicked", () => {
|
||||
cy.visit("http://192.168.10.167:3000/?m=12&u=485");
|
||||
|
||||
cy.get("#map").rightclick(400, 300);
|
||||
|
||||
cy.contains("Station öffnen (Tab)").click();
|
||||
|
||||
// Testen, ob ein neuer Tab mit dem richtigen Link geöffnet wird
|
||||
cy.window().then((win) => {
|
||||
cy.stub(win, "open").as("windowOpen");
|
||||
});
|
||||
|
||||
cy.get("@windowOpen").should("be.calledWith", "https://example.com"); // Ersetze dies durch die tatsächliche URL
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user