Use a button instead of a link to remove a marker

Using a button for interactive elements is better, as explained in
commit 5311daadf.

Since buttons with "type=button" do nothing by default, we no longer
need to call `preventDefault()` when clicking it.
This commit is contained in:
Javi Martín
2023-05-02 16:02:27 +02:00
parent 59ed975f81
commit 8b14522bf5
4 changed files with 12 additions and 12 deletions

View File

@@ -215,7 +215,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
do_login_for mappable.author, management: management
visit send(mappable_edit_path, id: mappable.id)
click_link "Remove map marker"
click_button "Remove map marker"
click_on "Save changes"
expect(page).not_to have_css(".map-location")
@@ -236,7 +236,7 @@ shared_examples "mappable" do |mappable_factory_name, mappable_association_name,
do_login_for mappable.author, management: management
visit send(mappable_edit_path, id: mappable.id)
click_link "Remove map marker"
click_button "Remove map marker"
click_on "Save changes"
expect(page).not_to have_content "Map location can't be blank"