Don't use confirm dialog in admin homepage form
In this case the confirmation dialog isn't really necessary since the action to enable/disable the setting can easily be undone. Furthermore, these tests were failing with Chrome 83, probably because we use `confirm_dialog` and then we use `visit` without checking the page in between. In theory we shouldn't need to check the page in between because the request generated by `confirm_dialog` is a synchronous one and so `visit` isn't executed after the previous request has finished, but apparently this behavior has changed in Chrome 83. We could add an expectation before executing the `visit` method, but that wouldn't improve the usability of the application.
This commit is contained in:
@@ -36,7 +36,7 @@ describe "Homepage" do
|
||||
|
||||
within("#widget_feed_#{proposals_feed.id}") do
|
||||
select "1", from: "widget_feed_limit"
|
||||
accept_confirm { click_button "Enable" }
|
||||
click_button "Enable"
|
||||
end
|
||||
|
||||
visit root_path
|
||||
@@ -55,7 +55,7 @@ describe "Homepage" do
|
||||
visit admin_homepage_path
|
||||
within("#widget_feed_#{debates_feed.id}") do
|
||||
select "2", from: "widget_feed_limit"
|
||||
accept_confirm { click_button "Enable" }
|
||||
click_button "Enable"
|
||||
end
|
||||
|
||||
visit root_path
|
||||
@@ -76,12 +76,12 @@ describe "Homepage" do
|
||||
|
||||
within("#widget_feed_#{proposals_feed.id}") do
|
||||
select "3", from: "widget_feed_limit"
|
||||
accept_confirm { click_button "Enable" }
|
||||
click_button "Enable"
|
||||
end
|
||||
|
||||
within("#widget_feed_#{debates_feed.id}") do
|
||||
select "3", from: "widget_feed_limit"
|
||||
accept_confirm { click_button "Enable" }
|
||||
click_button "Enable"
|
||||
end
|
||||
|
||||
visit root_path
|
||||
@@ -106,7 +106,7 @@ describe "Homepage" do
|
||||
visit admin_homepage_path
|
||||
within("#widget_feed_#{processes_feed.id}") do
|
||||
select "3", from: "widget_feed_limit"
|
||||
accept_confirm { click_button "Enable" }
|
||||
click_button "Enable"
|
||||
end
|
||||
|
||||
visit root_path
|
||||
|
||||
Reference in New Issue
Block a user