Use JavaScript in tests opening modal dialogs

This way we reproduce the user experience in the tests, and we can make
sure modal dialogs open when we expect it.
This commit is contained in:
Javi Martín
2021-03-29 13:28:41 +02:00
parent fbc78984dc
commit b2bc4d19f5
38 changed files with 221 additions and 178 deletions

View File

@@ -379,15 +379,17 @@ describe "Valuation budget investments" do
end
end
scenario "Finish valuation" do
scenario "Finish valuation", :js do
investment.update!(visible_to_valuators: true)
visit valuation_budget_budget_investment_path(budget, investment)
click_link "Edit dossier"
find_field("budget_investment[valuation_finished]").click
accept_confirm { find_field("budget_investment[valuation_finished]").click }
click_button "Save changes"
expect(page).to have_content "Dossier updated"
visit valuation_budget_budget_investments_path(budget)
expect(page).not_to have_content investment.title
click_link "Valuation finished"