Skip to content

Commit

Permalink
Fix spec
Browse files Browse the repository at this point in the history
  • Loading branch information
JoonasAapro committed Nov 28, 2024
1 parent dcf7fbf commit 675e8be
Showing 1 changed file with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,19 +211,15 @@ def add_marker(latitude: 11.521, longitude: 5.521)
it "generates a marker cluster" do
expect(page).to have_css("[data-decidim-map]")
expect(page).to have_css(".leaflet-marker-icon")
5.times do
find(".leaflet-control-zoom-out").click
end
zoom_out_max
expect(page).to have_css(".marker-cluster-small")
end

context "when marker clicked" do
it "shows markers separately" do
expect(page).to have_css("[data-decidim-map]")
expect(page).to have_css(".leaflet-marker-icon")
5.times do
find(".leaflet-control-zoom-out").click
end
zoom_out_max
expect(page).to have_css(".marker-cluster-small")
find(".marker-cluster-small").click
expect(page).to have_css(".leaflet-marker-pane > img", count: 2)
Expand Down Expand Up @@ -282,3 +278,11 @@ def add_marker(latitude: 11.521, longitude: 5.521)
end
end
end

def zoom_out_max
page.execute_script(
<<~JS
$("[data-decidim-map]").data("map").zoomOut(10)
JS
)
end

0 comments on commit 675e8be

Please sign in to comment.