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

Adapt specs to new format

Aaron Contrerase8e3ee87879e
diff --git a/modules/costs/spec/features/time_entries_spec.rb b/modules/costs/spec/features/time_entries_spec.rb
index eb7c5c03a42..cb0a76abe21 100644
--- a/modules/costs/spec/features/time_entries_spec.rb
+++ b/modules/costs/spec/features/time_entries_spec.rb
@@ -73,7 +73,7 @@ RSpec.describe "Work Package table cost entries", :js do
parent_row = wp_table.row(parent)
wp_row = wp_table.row(work_package)
- expect(parent_row).to have_css(".inline-edit--container.spentTime", text: "12h 30m")
+ expect(parent_row).to have_css(".inline-edit--container.spentTime", text: "1d 4h 30m")
expect(wp_row).to have_css(".inline-edit--container.spentTime", text: "2h 30m")
end
diff --git a/spec/features/activities/work_package_activity_spec.rb b/spec/features/activities/work_package_activity_spec.rb
index fd72f6f943b..3eab179c792 100644
--- a/spec/features/activities/work_package_activity_spec.rb
+++ b/spec/features/activities/work_package_activity_spec.rb
@@ -61,10 +61,10 @@ RSpec.describe "Work package activity", :js, :with_cuprite do
it "displays changed attributes in the activity tab", :aggregate_failures do
within("activity-entry", text: admin.name) do
expect(page).to have_list_item(text: "% Complete set to 50%")
- expect(page).to have_list_item(text: "Work set to 10h")
+ expect(page).to have_list_item(text: "Work set to 1d 2h")
expect(page).to have_list_item(text: "Remaining work set to 5h")
- expect(page).to have_list_item(text: "Total work set to 20h")
- expect(page).to have_list_item(text: "Total remaining work set to 8h")
+ expect(page).to have_list_item(text: "Total work set to 2d 4h")
+ expect(page).to have_list_item(text: "Total remaining work set to 1d")
expect(page).to have_list_item(text: "Total % complete set to 60%")
end
end
diff --git a/spec/features/work_packages/display_fields/work_display_spec.rb b/spec/features/work_packages/display_fields/work_display_spec.rb
index 7bbd7a756e4..ddfee0c921b 100644
--- a/spec/features/work_packages/display_fields/work_display_spec.rb
+++ b/spec/features/work_packages/display_fields/work_display_spec.rb
@@ -172,11 +172,11 @@ RSpec.describe "Work display", :js do
wp_table.visit_query query
# parent
- expect(page).to have_content("5h·Σ 20h")
- expect(page).to have_link("Σ 20h")
+ expect(page).to have_content("5h·Σ 2d 4h")
+ expect(page).to have_link("Σ 2d 4h")
# child 2
- expect(page).to have_content("3h·Σ 15h")
- expect(page).to have_link("Σ 15h")
+ expect(page).to have_content("3h·Σ 1d 7h")
+ expect(page).to have_link("Σ 1d 7h")
end
context "when clicking the link of a top parent" do
@@ -185,7 +185,7 @@ RSpec.describe "Work display", :js do
end
it "shows a work package table with a parent filter to list the direct children" do
- click_on("Σ 20h")
+ click_on("Σ 2d 4h")
wp_table.expect_work_package_count(4)
wp_table.expect_work_package_listed(parent, child1, child2, child3)
@@ -202,8 +202,8 @@ RSpec.describe "Work display", :js do
end
it "shows also all ancestors in the work package table" do
- expect(page).to have_content("Work\n3h·Σ 15h")
- click_on("Σ 15h")
+ expect(page).to have_content("Work\n3h·Σ 1d 7h")
+ click_on("Σ 1d 7h")
wp_table.expect_work_package_count(3)
wp_table.expect_work_package_listed(parent, child2, grand_child21)
diff --git a/spec/features/work_packages/edit_work_package_spec.rb b/spec/features/work_packages/edit_work_package_spec.rb
index e7308a5f04b..07d5d8bf2e4 100644
--- a/spec/features/work_packages/edit_work_package_spec.rb
+++ b/spec/features/work_packages/edit_work_package_spec.rb
@@ -143,7 +143,7 @@ RSpec.describe "edit work package", :js do
responsible: manager.name,
assignee: manager.name,
combinedDate: "03/04/2013 - 03/20/2013",
- estimatedTime: "10h",
+ estimatedTime: "1d 2h",
remainingTime: "7h",
percentageDone: "30%",
subject: "a new subject",
diff --git a/spec/features/work_packages/index_sums_spec.rb b/spec/features/work_packages/index_sums_spec.rb
index f94ea54f76c..896ea730cb8 100644
--- a/spec/features/work_packages/index_sums_spec.rb
+++ b/spec/features/work_packages/index_sums_spec.rb
@@ -146,8 +146,8 @@ RSpec.describe "Work package index sums", :js do
# Expect the total sums row
aggregate_failures do
within(:row, "Total sum") do |row|
- expect(row).to have_css(".estimatedTime", text: "1d 1h")
- expect(row).to have_css(".remainingTime", text: "12h 30m")
+ expect(row).to have_css(".estimatedTime", text: "3d 1h")
+ expect(row).to have_css(".remainingTime", text: "1d 4h 30m")
expect(row).to have_css(".#{int_cf.attribute_name(:camel_case)}", text: "12")
expect(row).to have_css(".#{float_cf.attribute_name(:camel_case)}", text: "13.2")
expect(row).to have_css(".laborCosts", text: "15.00 EUR")
@@ -164,8 +164,8 @@ RSpec.describe "Work package index sums", :js do
aggregate_failures do
within(:row, "Total sum") do |row|
- expect(row).to have_css(".estimatedTime", text: "1d 11h")
- expect(row).to have_css(".remainingTime", text: "19h 30m")
+ expect(row).to have_css(".estimatedTime", text: "4d 3h")
+ expect(row).to have_css(".remainingTime", text: "2d 3h 30m")
expect(row).to have_css(".#{int_cf.attribute_name(:camel_case)}", text: "12")
expect(row).to have_css(".#{float_cf.attribute_name(:camel_case)}", text: "13.2")
expect(row).to have_css(".laborCosts", text: "15.00 EUR")
@@ -184,8 +184,8 @@ RSpec.describe "Work package index sums", :js do
first_sum_row, second_sum_row = *find_all(:row, "Sum")
# First status row
aggregate_failures do
- expect(first_sum_row).to have_css(".estimatedTime", text: "20h")
- expect(first_sum_row).to have_css(".remainingTime", text: "12h")
+ expect(first_sum_row).to have_css(".estimatedTime", text: "2d 4h")
+ expect(first_sum_row).to have_css(".remainingTime", text: "1d 4h")
expect(first_sum_row).to have_css(".#{int_cf.attribute_name(:camel_case)}", text: "5")
expect(first_sum_row).to have_css(".#{float_cf.attribute_name(:camel_case)}", text: "5.5")
expect(first_sum_row).to have_css(".laborCosts", text: "15.00 EUR")
@@ -195,7 +195,7 @@ RSpec.describe "Work package index sums", :js do
# Second status row
aggregate_failures do
- expect(second_sum_row).to have_css(".estimatedTime", text: "15h")
+ expect(second_sum_row).to have_css(".estimatedTime", text: "1d 7h")
expect(second_sum_row).to have_css(".remainingTime", text: "7h 30m")
expect(second_sum_row).to have_css(".#{int_cf.attribute_name(:camel_case)}", text: "7")
expect(second_sum_row).to have_css(".#{float_cf.attribute_name(:camel_case)}", text: "7.7")
@@ -207,8 +207,8 @@ RSpec.describe "Work package index sums", :js do
# Total sums row is unchanged
aggregate_failures do
within(:row, "Total sum") do |row|
- expect(row).to have_css(".estimatedTime", text: "1d 11h")
- expect(row).to have_css(".remainingTime", text: "19h 30m")
+ expect(row).to have_css(".estimatedTime", text: "4d 3h")
+ expect(row).to have_css(".remainingTime", text: "2d 3h 30m")
expect(row).to have_css(".#{int_cf.attribute_name(:camel_case)}", text: "12")
expect(row).to have_css(".#{float_cf.attribute_name(:camel_case)}", text: "13.2")
expect(row).to have_css(".laborCosts", text: "15.00 EUR")
@@ -282,8 +282,8 @@ RSpec.describe "Work package index sums", :js do
# Expect the total sums row without filtering
aggregate_failures do
within(:row, "Total sum") do |row|
- expect(row).to have_css(".estimatedTime", text: "2d 2h")
- expect(row).to have_css(".remainingTime", text: "1d 1h")
+ expect(row).to have_css(".estimatedTime", text: "1w 1d 2h")
+ expect(row).to have_css(".remainingTime", text: "3d 1h")
expect(row).to have_css(".#{int_cf.attribute_name(:camel_case)}", text: "24")
expect(row).to have_css(".#{float_cf.attribute_name(:camel_case)}", text: "26.4")
expect(row).to have_css(".laborCosts", text: "40.00 EUR")
@@ -303,8 +303,8 @@ RSpec.describe "Work package index sums", :js do
# Expect the total sums row to have changed
aggregate_failures do
within(:row, "Total sum") do |row|
- expect(row).to have_css(".estimatedTime", text: "1d 6h")
- expect(row).to have_css(".remainingTime", text: "15h")
+ expect(row).to have_css(".estimatedTime", text: "3d 6h")
+ expect(row).to have_css(".remainingTime", text: "1d 7h")
expect(row).to have_css(".#{int_cf.attribute_name(:camel_case)}", text: "14")
expect(row).to have_css(".#{float_cf.attribute_name(:camel_case)}", text: "15.4")
expect(row).to have_css(".laborCosts", text: "", exact_text: true)
@@ -328,7 +328,7 @@ RSpec.describe "Work package index sums", :js do
first_sum_row, second_sum_row = *find_all(:row, "Sum")
# First status row
aggregate_failures do
- expect(first_sum_row).to have_css(".estimatedTime", text: "10h")
+ expect(first_sum_row).to have_css(".estimatedTime", text: "1d 2h")
expect(first_sum_row).to have_css(".remainingTime", text: "5h")
expect(first_sum_row).to have_css(".#{int_cf.attribute_name(:camel_case)}", text: "5")
expect(first_sum_row).to have_css(".#{float_cf.attribute_name(:camel_case)}", text: "5.5")
@@ -339,7 +339,7 @@ RSpec.describe "Work package index sums", :js do
# Second status row
aggregate_failures do
- expect(second_sum_row).to have_css(".estimatedTime", text: "15h")
+ expect(second_sum_row).to have_css(".estimatedTime", text: "1d 7h")
expect(second_sum_row).to have_css(".remainingTime", text: "7h 30m")
expect(second_sum_row).to have_css(".#{int_cf.attribute_name(:camel_case)}", text: "7")
expect(second_sum_row).to have_css(".#{float_cf.attribute_name(:camel_case)}", text: "7.7")
@@ -351,8 +351,8 @@ RSpec.describe "Work package index sums", :js do
# Total sum
aggregate_failures do
within(:row, "Total sum") do |row|
- expect(row).to have_css(".estimatedTime", text: "1d 1h")
- expect(row).to have_css(".remainingTime", text: "12h 30m")
+ expect(row).to have_css(".estimatedTime", text: "3d 1h")
+ expect(row).to have_css(".remainingTime", text: "1d 4h 30m")
expect(row).to have_css(".#{int_cf.attribute_name(:camel_case)}", text: "12")
expect(row).to have_css(".#{float_cf.attribute_name(:camel_case)}", text: "13.2")
expect(row).to have_css(".laborCosts", text: "15.00 EUR")
diff --git a/spec/features/work_packages/progress_modal_spec.rb b/spec/features/work_packages/progress_modal_spec.rb
index 3ce42590614..3e4b7b9f7fa 100644
--- a/spec/features/work_packages/progress_modal_spec.rb
+++ b/spec/features/work_packages/progress_modal_spec.rb
@@ -350,7 +350,7 @@ RSpec.describe "Progress modal", :js, :with_cuprite do
work_edit_field.activate!
- work_edit_field.expect_modal_field_value("10h")
+ work_edit_field.expect_modal_field_value("1d 2h")
remaining_work_edit_field.expect_modal_field_value("2h 7m 12s")
percent_complete_edit_field.expect_modal_field_value("78", readonly: true)
end
@@ -521,7 +521,7 @@ RSpec.describe "Progress modal", :js, :with_cuprite do
specify "Case 2: when work is set to 12h, " \
"remaining work is automatically set to 6h " \
"and subsequently work is set to 14h, " \
- "remaining work updates to 8h" do
+ "remaining work updates to 1d" do
work_package_table.visit_query(progress_query)
work_package_table.expect_work_package_listed(work_package)
@@ -537,7 +537,7 @@ RSpec.describe "Progress modal", :js, :with_cuprite do
work_edit_field.set_value("14")
page.driver.wait_for_network_idle # Wait for live-update to finish
- remaining_work_edit_field.expect_modal_field_value("8h")
+ remaining_work_edit_field.expect_modal_field_value("1d")
end
specify "Case 3: when work is set to 2h, " \
diff --git a/spec/features/work_packages/remaining_time_spec.rb b/spec/features/work_packages/remaining_time_spec.rb
index 7283d7142db..599d999fec3 100644
--- a/spec/features/work_packages/remaining_time_spec.rb
+++ b/spec/features/work_packages/remaining_time_spec.rb
@@ -50,7 +50,7 @@ RSpec.describe "Work packages remaining time", :js, :with_cuprite do
# need to update work first to enable the remaining work field
wp_page.update_attributes estimatedTime: "200" # rubocop:disable Rails/ActiveRecordAliases
wp_page.update_attributes remainingTime: "125" # rubocop:disable Rails/ActiveRecordAliases
- wp_page.expect_attributes remainingTime: "5d 5h"
+ wp_page.expect_attributes remainingTime: "3w 5h"
work_package.reload
expect(work_package.remaining_hours).to eq 125.0
@@ -70,8 +70,8 @@ RSpec.describe "Work packages remaining time", :js, :with_cuprite do
# need to update work first to enable the remaining work field
wp_table_page.update_work_package_attributes work_package, estimatedTime: "200"
wp_table_page.update_work_package_attributes work_package, remainingTime: "125"
- wp_table_page.expect_work_package_with_attributes work_package, remainingTime: "5d 5h"
- wp_table_page.expect_sums_row_with_attributes remainingTime: "5d 5h"
+ wp_table_page.expect_work_package_with_attributes work_package, remainingTime: "3w 5h"
+ wp_table_page.expect_sums_row_with_attributes remainingTime: "3w 5h"
work_package.reload
expect(work_package.remaining_hours).to eq 125.0