diff --git a/sites/public/cypress/e2e/pages/listings-map.spec.ts b/sites/public/cypress/e2e/pages/listings-map.spec.ts index 8b9d460ddf..7bab83f193 100644 --- a/sites/public/cypress/e2e/pages/listings-map.spec.ts +++ b/sites/public/cypress/e2e/pages/listings-map.spec.ts @@ -1,7 +1,7 @@ // When testing this locally, ensure your screen size compares to Cypress's screen size as it will affect the way the map creates clusters describe("Listings map", function () { it("renders the listing map", function () { - cy.viewport(905, 1100) + cy.viewport(1500, 1100) cy.intercept("**/listings/mapMarkers", (req) => { req.headers["language"] = "en" }).as("markersSearch") @@ -19,7 +19,7 @@ describe("Listings map", function () { // Initial map load cy.getByTestId("map-total-results").contains("Total results 249") cy.getByTestId("map-pagination").contains("Page 1 of 10") - cy.getByTestId("map-cluster").should("have.length", 8) + cy.getByTestId("map-cluster").should("have.length", 17) cy.getByTestId("loading-overlay").should("not.exist") // Fetch markers + listings once on page load @@ -27,11 +27,9 @@ describe("Listings map", function () { cy.get("@listingsSearch.all").should("have.length", 1) // Click into one cluster - cy.get('[aria-label="109 listings in this cluster"]').contains("109").click({ force: true }) - cy.get('[aria-label="32 listings in this cluster"]').contains("32") - cy.getByTestId("map-cluster").should("have.length", 25) - cy.getByTestId("map-total-results").contains("Total results 182") - cy.getByTestId("map-pagination").contains("Page 1 of 8") + cy.get('[aria-label="58 listings in this cluster"]').contains("58").click({ force: true }) + cy.getByTestId("map-total-results").contains("Total results 83") + cy.getByTestId("map-pagination").contains("Page 1 of 4") cy.getByTestId("loading-overlay").should("not.exist") // Not filtering, just panning - only fetch listings @@ -39,8 +37,8 @@ describe("Listings map", function () { cy.get("@listingsSearch.all").should("have.length", 2) // Click into another cluster - cy.get('[aria-label="5 listings in this cluster"]').contains("5").click() - cy.getByTestId("map-total-results").contains("Total results 5") + cy.get('[aria-label="3 listings in this cluster"]').contains("3").click() + cy.getByTestId("map-total-results").contains("Total results 4") cy.getByTestId("map-pagination").contains("Page 1 of 1") cy.getByTestId("loading-overlay").should("not.exist") @@ -85,7 +83,10 @@ describe("Listings map", function () { cy.getByTestId("map-total-results").contains("Total results 4") cy.getByTestId("loading-overlay").should("not.exist") cy.getByTestId("map").dblclick(100, 20) - cy.getByTestId("map-total-results").contains("Total results 0") + cy.getByTestId("map-total-results").contains("Total results 2") + cy.getByTestId("loading-overlay").should("not.exist") + cy.getByTestId("map").dblclick(100, 20) + cy.getByTestId("map-total-results").contains("Total results 2") cy.contains("No matching listings") cy.getByTestId("loading-overlay").should("not.exist") @@ -97,7 +98,7 @@ describe("Listings map", function () { cy.getByTestId("loading-overlay").should("not.exist") cy.getByTestId("map-zoom-out").click() cy.getByTestId("loading-overlay").should("not.exist") - cy.getByTestId("map-total-results").contains("Total results 5") + cy.getByTestId("map-total-results").contains("Total results 4") cy.get("@listingsSearch.all").should("have.length", 6) }) })