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

include grouping behaviour into spec

ulferts772d0b8d2b3d
diff --git a/spec/features/custom_fields/multi_value_custom_field_spec.rb b/spec/features/custom_fields/multi_value_custom_field_spec.rb
index 0cc7eee400a..5afff1e01f3 100644
--- a/spec/features/custom_fields/multi_value_custom_field_spec.rb
+++ b/spec/features/custom_fields/multi_value_custom_field_spec.rb
@@ -166,6 +166,11 @@ describe "multi select custom values", js: true do
field.expect_state_text '-'
wp1_field.expect_state_text '-'
+ # Expect changed groups
+ expect(page).to have_selector('.group--value .count', count: 2)
+ expect(page).to have_selector('.group--value', text: '- (1)')
+ expect(page).to have_selector('.group--value', text: 'ham (1)')
+
# Activate again
field.activate!
@@ -174,6 +179,11 @@ describe "multi select custom values", js: true do
field.submit_by_dashboard
+ # Expect changed groups
+ expect(page).to have_selector('.group--value .count', count: 2)
+ expect(page).to have_selector('.group--value', text: 'ham, onions (1)')
+ expect(page).to have_selector('.group--value', text: 'ham (1)')
+
expect(field.display_element).to have_text('ham')
expect(field.display_element).to have_text('onions')
wp1_field.expect_state_text 'ham, onions'
@@ -188,6 +198,11 @@ describe "multi select custom values", js: true do
expect(field.display_element).to have_text('pineapple')
expect(field.display_element).to have_text('mushrooms')
+ # Expect changed groups
+ expect(page).to have_selector('.group--value .count', count: 2)
+ expect(page).to have_selector('.group--value', text: 'ham, mushrooms, onions, pineapple (1)')
+ expect(page).to have_selector('.group--value', text: 'ham (1)')
+
wp1_field.expect_state_text ", ...\n4"
end
end