21 lines
698 B
JavaScript
21 lines
698 B
JavaScript
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);
|
|
});
|
|
});
|
|
});
|