Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Wait for cost entry to update after save

Kabiru Mwenja661c371e3790
diff --git a/modules/costs/spec/features/cost_entries/add_cost_entry_spec.rb b/modules/costs/spec/features/cost_entries/add_cost_entry_spec.rb
index d7879c83bda..18ed2734355 100644
--- a/modules/costs/spec/features/cost_entries/add_cost_entry_spec.rb
+++ b/modules/costs/spec/features/cost_entries/add_cost_entry_spec.rb
@@ -149,7 +149,9 @@ RSpec.describe "Work Package cost fields", :js do
fill_in "cost_entry_overridden_costs", with: "55.000,55"
click_on I18n.t(:button_save)
- expect(page).to have_css("#cost_entry_costs", text: "55.000,55 EUR")
+ # Add explicit wait for the updated cost value
+ wait_for { page }.to have_css("#cost_entry_costs", text: "55.000,55 EUR")
+
entry.reload
expect(entry.units).to eq(1.42)
expect(entry.costs).to eq(2.84)