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

Test for unset total values

Aaron Contreras5b1dbb45c8a1
diff --git a/spec/workers/work_packages/progress/apply_statuses_change_job_spec.rb b/spec/workers/work_packages/progress/apply_statuses_change_job_spec.rb
index 048a5ead005..a626c2d08e5 100644
--- a/spec/workers/work_packages/progress/apply_statuses_change_job_spec.rb
+++ b/spec/workers/work_packages/progress/apply_statuses_change_job_spec.rb
@@ -306,6 +306,23 @@ RSpec.describe WorkPackages::Progress::ApplyStatusesChangeJob do
TABLE
)
end
+
+ context "when total work and remaining work values are null" do
+ it "recomputes the total % complete to null" do
+ expect_performing_job_changes(
+ from: <<~TABLE,
+ hierarchy | status | work | remaining work | % complete | ∑ work | ∑ remaining work | ∑ % complete
+ grandparent | Doing (40%) | | | 40% | | | 40%
+ parent | Doing (40%) | | | 40% | | | 40%
+ TABLE
+ to: <<~TABLE
+ hierarchy | status | work | remaining work | % complete | ∑ work | ∑ remaining work | ∑ % complete
+ grandparent | Doing (40%) | | | 40% | | |
+ parent | Doing (40%) | | | 40% | | |
+ TABLE
+ )
+ end
+ end
end
context "when in hierarchy in simple average mode",