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 navigation spec for bim

Oliver Günther40f18aec5223
diff --git a/lib/open_project/configuration/helpers.rb b/lib/open_project/configuration/helpers.rb
index e6c698c09a4..955b914ae4a 100644
--- a/lib/open_project/configuration/helpers.rb
+++ b/lib/open_project/configuration/helpers.rb
@@ -77,6 +77,12 @@ module OpenProject
array self['blacklisted_routes']
end
+ ##
+ # Whether we're running a bim edition
+ def bim?
+ ENV['OPENPROJECT_EDITION'] == 'bim'
+ end
+
def available_file_uploaders
uploaders = {
diff --git a/spec/features/work_packages/navigation_spec.rb b/spec/features/work_packages/navigation_spec.rb
index 63f06d02029..642c342b2bf 100644
--- a/spec/features/work_packages/navigation_spec.rb
+++ b/spec/features/work_packages/navigation_spec.rb
@@ -40,7 +40,7 @@ RSpec.feature 'Work package navigation', js: true, selenium: true do
end
let!(:query) do
- query = FactoryBot.build(:query, user: user, project: project)
+ query = FactoryBot.build(:query, user: user, project: project)
query.column_names = %w(id subject)
query.name = "My fancy query"
@@ -203,6 +203,11 @@ RSpec.feature 'Work package navigation', js: true, selenium: true do
# Click on All open
find('.wp-query-menu--item-link', text: 'All open').click
- wp_display.expect_state 'Table'
+
+ if OpenProject::Configuration.bim?
+ wp_display.expect_state 'Cards'
+ else
+ wp_display.expect_state 'Table'
+ end
end
end