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

Fix test flakiness

Christophe Bliarde027383487fc
diff --git a/spec/support/edit_fields/edit_field.rb b/spec/support/edit_fields/edit_field.rb
index cd1801a7170..414463a7c36 100644
--- a/spec/support/edit_fields/edit_field.rb
+++ b/spec/support/edit_fields/edit_field.rb
@@ -39,6 +39,10 @@ class EditField
@create_form
end
+ def visible_on_create_form?
+ true
+ end
+
def field_container
context.find @selector
end
@@ -128,7 +132,7 @@ class EditField
end
def expect_state!(open:)
- if open || create_form?
+ if open || (create_form? && visible_on_create_form?)
expect_active!
else
expect_inactive!
diff --git a/spec/support/edit_fields/progress_edit_field.rb b/spec/support/edit_fields/progress_edit_field.rb
index 775cc0a42fe..2755dda336f 100644
--- a/spec/support/edit_fields/progress_edit_field.rb
+++ b/spec/support/edit_fields/progress_edit_field.rb
@@ -49,6 +49,10 @@ class ProgressEditField < EditField
@trigger_selector = "input[id$=inline-edit--field-#{@property_name}]"
end
+ def visible_on_create_form?
+ false
+ end
+
def update(value, save: true, expect_failure: false)
super
end