Make map location HTML class names consistent
We were using `map_location` in one place and `location-map-remove-marker` in another one. We usually use dashes in HTML class names, we don't say "location map" anywhere else.
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
.location-map-remove-marker {
|
.map-location-remove-marker {
|
||||||
border-bottom: 1px dotted #cf2a0e;
|
border-bottom: 1px dotted #cf2a0e;
|
||||||
color: $delete;
|
color: $delete;
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<%= tag.div(id: dom_id(map_location), class: "map_location map", data: data) %>
|
<%= tag.div(id: dom_id(map_location), class: "map-location map", data: data) %>
|
||||||
|
|
||||||
<% if editable? %>
|
<% if editable? %>
|
||||||
<%= remove_marker %>
|
<%= remove_marker %>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ class Shared::MapLocationComponent < ApplicationComponent
|
|||||||
tag.div class: "margin-bottom" do
|
tag.div class: "margin-bottom" do
|
||||||
link_to remove_marker_label, "#",
|
link_to remove_marker_label, "#",
|
||||||
id: remove_marker_link_id,
|
id: remove_marker_link_id,
|
||||||
class: "location-map-remove-marker"
|
class: "map-location-remove-marker"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
|
|
||||||
send("fill_in_#{mappable_factory_name}_form")
|
send("fill_in_#{mappable_factory_name}_form")
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).not_to have_css(".map-icon")
|
expect(page).not_to have_css(".map-icon")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -30,7 +30,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
send("fill_in_#{mappable_factory_name}_form")
|
send("fill_in_#{mappable_factory_name}_form")
|
||||||
find("#new_map_location").click
|
find("#new_map_location").click
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon")
|
expect(page).to have_css(".map-icon")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -43,7 +43,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
find("#new_map_location").click
|
find("#new_map_location").click
|
||||||
send("submit_#{mappable_factory_name}_form")
|
send("submit_#{mappable_factory_name}_form")
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon")
|
expect(page).to have_css(".map-icon")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -53,10 +53,10 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
visit send(mappable_new_path, arguments)
|
visit send(mappable_new_path, arguments)
|
||||||
|
|
||||||
send("fill_in_#{mappable_factory_name}_form")
|
send("fill_in_#{mappable_factory_name}_form")
|
||||||
expect(page).to have_css ".map_location"
|
expect(page).to have_css ".map-location"
|
||||||
send("submit_#{mappable_factory_name}_form")
|
send("submit_#{mappable_factory_name}_form")
|
||||||
|
|
||||||
expect(page).not_to have_css(".map_location")
|
expect(page).not_to have_css(".map-location")
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Can not display map on #{mappable_factory_name} when feature.map is disabled" do
|
scenario "Can not display map on #{mappable_factory_name} when feature.map is disabled" do
|
||||||
@@ -65,10 +65,10 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
visit send(mappable_new_path, arguments)
|
visit send(mappable_new_path, arguments)
|
||||||
|
|
||||||
send("fill_in_#{mappable_factory_name}_form")
|
send("fill_in_#{mappable_factory_name}_form")
|
||||||
expect(page).not_to have_css ".map_location"
|
expect(page).not_to have_css ".map-location"
|
||||||
send("submit_#{mappable_factory_name}_form")
|
send("submit_#{mappable_factory_name}_form")
|
||||||
|
|
||||||
expect(page).not_to have_css(".map_location")
|
expect(page).not_to have_css(".map-location")
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "When restoring the page from browser history" do
|
describe "When restoring the page from browser history" do
|
||||||
@@ -90,7 +90,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
|
|
||||||
go_back
|
go_back
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".leaflet-map-pane", count: 1)
|
expect(page).to have_css(".leaflet-map-pane", count: 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -99,7 +99,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
do_login_for user, management: management
|
do_login_for user, management: management
|
||||||
visit send(mappable_new_path, arguments)
|
visit send(mappable_new_path, arguments)
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).not_to have_css(".map-icon")
|
expect(page).not_to have_css(".map-icon")
|
||||||
end
|
end
|
||||||
expect(page.execute_script("return App.Map.maps[0].getZoom();")).to eq(10)
|
expect(page.execute_script("return App.Map.maps[0].getZoom();")).to eq(10)
|
||||||
@@ -107,7 +107,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
map_zoom_in
|
map_zoom_in
|
||||||
find("#new_map_location").click
|
find("#new_map_location").click
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon")
|
expect(page).to have_css(".map-icon")
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
|
|
||||||
go_back
|
go_back
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon")
|
expect(page).to have_css(".map-icon")
|
||||||
expect(page.execute_script("return App.Map.maps[0].getZoom();")).to eq(11)
|
expect(page.execute_script("return App.Map.maps[0].getZoom();")).to eq(11)
|
||||||
end
|
end
|
||||||
@@ -133,14 +133,14 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
do_login_for user, management: management
|
do_login_for user, management: management
|
||||||
visit send(mappable_new_path, arguments)
|
visit send(mappable_new_path, arguments)
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).not_to have_css(".map-icon")
|
expect(page).not_to have_css(".map-icon")
|
||||||
end
|
end
|
||||||
|
|
||||||
place_map_at(-68.592487, -62.391357)
|
place_map_at(-68.592487, -62.391357)
|
||||||
find("#new_map_location").click
|
find("#new_map_location").click
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon")
|
expect(page).to have_css(".map-icon")
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -156,7 +156,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
|
|
||||||
go_back
|
go_back
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon")
|
expect(page).to have_css(".map-icon")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -189,13 +189,13 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
do_login_for mappable.author, management: management
|
do_login_for mappable.author, management: management
|
||||||
|
|
||||||
visit send(mappable_edit_path, id: mappable.id)
|
visit send(mappable_edit_path, id: mappable.id)
|
||||||
find(".map_location").click
|
find(".map-location").click
|
||||||
click_on("Save changes")
|
click_on("Save changes")
|
||||||
mappable.reload
|
mappable.reload
|
||||||
|
|
||||||
expect(page).to have_css(".map_location")
|
expect(page).to have_css(".map-location")
|
||||||
expect(page).not_to have_selector(".map_location[data-marker-latitude='#{map_location.latitude}']")
|
expect(page).not_to have_selector(".map-location[data-marker-latitude='#{map_location.latitude}']")
|
||||||
expect(page).to have_selector(".map_location[data-marker-latitude='#{mappable.map_location.latitude}']")
|
expect(page).to have_selector(".map-location[data-marker-latitude='#{mappable.map_location.latitude}']")
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Should edit mappable on #{mappable_factory_name} without change map" do
|
scenario "Should edit mappable on #{mappable_factory_name} without change map" do
|
||||||
@@ -206,9 +206,9 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
click_on("Save changes")
|
click_on("Save changes")
|
||||||
mappable.reload
|
mappable.reload
|
||||||
|
|
||||||
expect(page).to have_css(".map_location")
|
expect(page).to have_css(".map-location")
|
||||||
expect(page).to have_selector(".map_location[data-marker-latitude='#{map_location.latitude}']")
|
expect(page).to have_selector(".map-location[data-marker-latitude='#{map_location.latitude}']")
|
||||||
expect(page).to have_selector(".map_location[data-marker-latitude='#{mappable.map_location.latitude}']")
|
expect(page).to have_selector(".map-location[data-marker-latitude='#{mappable.map_location.latitude}']")
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Can not display map on #{mappable_factory_name} edit when remove map marker" do
|
scenario "Can not display map on #{mappable_factory_name} edit when remove map marker" do
|
||||||
@@ -218,7 +218,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
click_link "Remove map marker"
|
click_link "Remove map marker"
|
||||||
click_on "Save changes"
|
click_on "Save changes"
|
||||||
|
|
||||||
expect(page).not_to have_css(".map_location")
|
expect(page).not_to have_css(".map-location")
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Can not display map on #{mappable_factory_name} edit when feature.map is disabled" do
|
scenario "Can not display map on #{mappable_factory_name} edit when feature.map is disabled" do
|
||||||
@@ -229,7 +229,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
fill_in "#{mappable_factory_name.camelize} title", with: "New title"
|
fill_in "#{mappable_factory_name.camelize} title", with: "New title"
|
||||||
click_on("Save changes")
|
click_on("Save changes")
|
||||||
|
|
||||||
expect(page).not_to have_css(".map_location")
|
expect(page).not_to have_css(".map-location")
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "No need to skip map on update" do
|
scenario "No need to skip map on update" do
|
||||||
@@ -254,7 +254,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
do_login_for user, management: management if management
|
do_login_for user, management: management if management
|
||||||
visit send(mappable_show_path, arguments)
|
visit send(mappable_show_path, arguments)
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon")
|
expect(page).to have_css(".map-icon")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -267,7 +267,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
do_login_for user, management: management if management
|
do_login_for user, management: management if management
|
||||||
visit send(mappable_show_path, arguments)
|
visit send(mappable_show_path, arguments)
|
||||||
|
|
||||||
expect(page).not_to have_css(".map_location")
|
expect(page).not_to have_css(".map-location")
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Should not display map on #{mappable_factory_name} show page when feature.map is disable" do
|
scenario "Should not display map on #{mappable_factory_name} show page when feature.map is disable" do
|
||||||
@@ -277,7 +277,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
|
|||||||
do_login_for user, management: management if management
|
do_login_for user, management: management if management
|
||||||
visit send(mappable_show_path, arguments)
|
visit send(mappable_show_path, arguments)
|
||||||
|
|
||||||
expect(page).not_to have_css(".map_location")
|
expect(page).not_to have_css(".map-location")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -270,7 +270,7 @@ describe "Budgets" do
|
|||||||
|
|
||||||
visit budgets_path
|
visit budgets_path
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon", count: 3, visible: :all)
|
expect(page).to have_css(".map-icon", count: 3, visible: :all)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -290,7 +290,7 @@ describe "Budgets" do
|
|||||||
|
|
||||||
visit budgets_path
|
visit budgets_path
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon", count: 4, visible: :all)
|
expect(page).to have_css(".map-icon", count: 4, visible: :all)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -310,7 +310,7 @@ describe "Budgets" do
|
|||||||
|
|
||||||
visit budgets_path
|
visit budgets_path
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon", count: 2, visible: :all)
|
expect(page).to have_css(".map-icon", count: 2, visible: :all)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -338,7 +338,7 @@ describe "Budgets" do
|
|||||||
|
|
||||||
visit budgets_path
|
visit budgets_path
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon", count: 1, visible: :all)
|
expect(page).to have_css(".map-icon", count: 1, visible: :all)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -122,7 +122,7 @@ describe "Budget Investments" do
|
|||||||
create(:budget_investment, heading: heading)
|
create(:budget_investment, heading: heading)
|
||||||
visit budget_investments_path(budget, heading_id: heading.id)
|
visit budget_investments_path(budget, heading_id: heading.id)
|
||||||
within("#sidebar") do
|
within("#sidebar") do
|
||||||
expect(page).to have_css(".map_location")
|
expect(page).to have_css(".map-location")
|
||||||
end
|
end
|
||||||
|
|
||||||
unlocated_heading = create(:budget_heading, name: "No Map", price: 500, group: group,
|
unlocated_heading = create(:budget_heading, name: "No Map", price: 500, group: group,
|
||||||
@@ -130,7 +130,7 @@ describe "Budget Investments" do
|
|||||||
create(:budget_investment, heading: unlocated_heading)
|
create(:budget_investment, heading: unlocated_heading)
|
||||||
visit budget_investments_path(budget, heading_id: unlocated_heading.id)
|
visit budget_investments_path(budget, heading_id: unlocated_heading.id)
|
||||||
within("#sidebar") do
|
within("#sidebar") do
|
||||||
expect(page).not_to have_css(".map_location")
|
expect(page).not_to have_css(".map-location")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -1637,7 +1637,7 @@ describe "Budget Investments" do
|
|||||||
|
|
||||||
visit budget_investments_path(budget, heading_id: heading.id)
|
visit budget_investments_path(budget, heading_id: heading.id)
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon", count: 6, visible: :all)
|
expect(page).to have_css(".map-icon", count: 6, visible: :all)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1651,7 +1651,7 @@ describe "Budget Investments" do
|
|||||||
|
|
||||||
visit budget_investments_path(budget, heading_id: heading.id)
|
visit budget_investments_path(budget, heading_id: heading.id)
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon", count: 2, visible: :all)
|
expect(page).to have_css(".map-icon", count: 2, visible: :all)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1675,7 +1675,7 @@ describe "Budget Investments" do
|
|||||||
|
|
||||||
visit budget_investments_path(budget, heading_id: heading.id)
|
visit budget_investments_path(budget, heading_id: heading.id)
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon", count: 4, visible: :all)
|
expect(page).to have_css(".map-icon", count: 4, visible: :all)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1693,7 +1693,7 @@ describe "Budget Investments" do
|
|||||||
|
|
||||||
visit budget_investments_path(budget, heading_id: heading.id)
|
visit budget_investments_path(budget, heading_id: heading.id)
|
||||||
|
|
||||||
within ".map_location" do
|
within ".map-location" do
|
||||||
expect(page).to have_css(".map-icon", count: 0, visible: :all)
|
expect(page).to have_css(".map-icon", count: 0, visible: :all)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -1711,7 +1711,7 @@ describe "Budget Investments" do
|
|||||||
expect(page).to have_css(".budget-investment", count: 2)
|
expect(page).to have_css(".budget-investment", count: 2)
|
||||||
end
|
end
|
||||||
|
|
||||||
within(".map_location") do
|
within(".map-location") do
|
||||||
expect(page).to have_css(".map-icon", count: 3, visible: :all)
|
expect(page).to have_css(".map-icon", count: 3, visible: :all)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user