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 failing tests in boards

Behrokh Satarnejad38019b679945
diff --git a/modules/boards/app/controllers/boards/boards_controller.rb b/modules/boards/app/controllers/boards/boards_controller.rb
index 165b522196d..b9a271d5d53 100644
--- a/modules/boards/app/controllers/boards/boards_controller.rb
+++ b/modules/boards/app/controllers/boards/boards_controller.rb
@@ -23,6 +23,12 @@ module ::Boards
render layout: "angular/angular"
end
+ def default_breadcrumb; end
+
+ def show_local_breadcrumb
+ false
+ end
+
def new; end
def create
diff --git a/modules/boards/app/views/boards/boards/index.html.erb b/modules/boards/app/views/boards/boards/index.html.erb
index 1d4a6287e89..33c4d40e6ec 100644
--- a/modules/boards/app/views/boards/boards/index.html.erb
+++ b/modules/boards/app/views/boards/boards/index.html.erb
@@ -40,7 +40,7 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render Primer::OpenProject::SubHeader.new do |subheader|
- subheader.with_action_component do
+ subheader.with_action_component(data: { "test-selector": "add-board-button"}) do
render Boards::AddButtonComponent.new(current_project: @project)
end
end
diff --git a/modules/boards/spec/features/board_enterprise_spec.rb b/modules/boards/spec/features/board_enterprise_spec.rb
index d3c85a2bc99..7edb5ba2d1e 100644
--- a/modules/boards/spec/features/board_enterprise_spec.rb
+++ b/modules/boards/spec/features/board_enterprise_spec.rb
@@ -54,7 +54,7 @@ RSpec.describe "Boards enterprise spec", :js, :with_cuprite do
end
it "disabled all action boards" do
- page.find(".toolbar-item a", text: "Board").click
+ page.find('[data-test-selector="add-board-button"]', text: "Board").click
expect(page).to have_css("#{test_selector('op-tile-block')}:not(.-disabled)", text: "Basic")
expect(page).to have_css("#{test_selector('op-tile-block')}.-disabled", count: 5)
@@ -83,7 +83,7 @@ RSpec.describe "Boards enterprise spec", :js, :with_cuprite do
end
it "enables all options" do
- page.find(".toolbar-item a", text: "Board").click
+ page.find('[data-test-selector="add-board-button"]', text: "Board").click
expect(page).to have_css("#{test_selector('op-tile-block')}:not(.-disabled)", count: 6)
end
diff --git a/modules/boards/spec/features/support/board_index_page.rb b/modules/boards/spec/features/support/board_index_page.rb
index cb9535c146c..4f438e22ab6 100644
--- a/modules/boards/spec/features/support/board_index_page.rb
+++ b/modules/boards/spec/features/support/board_index_page.rb
@@ -59,7 +59,7 @@ module Pages
def create_board(action: "Basic", title: "#{action} Board", expect_empty: false, via_toolbar: true)
if via_toolbar
- within ".toolbar-items" do
+ within '[data-test-selector="add-board-button"]' do
click_link "Board"
end
else
diff --git a/modules/boards/spec/features/support/board_list_page.rb b/modules/boards/spec/features/support/board_list_page.rb
index 9e28dc035c3..921ae9ad134 100644
--- a/modules/boards/spec/features/support/board_list_page.rb
+++ b/modules/boards/spec/features/support/board_list_page.rb
@@ -35,13 +35,13 @@ module Pages
end
def expect_create_button
- within ".toolbar-items" do
+ within '[data-test-selector="add-board-button"]' do
expect(page).to have_link "Board"
end
end
def expect_no_create_button
- within ".toolbar-items" do
+ within '[data-test-selector="add-board-button"]' do
expect(page).to have_no_link "Board"
end
end
diff --git a/modules/boards/spec/features/support/board_new_page.rb b/modules/boards/spec/features/support/board_new_page.rb
index e31ddd472ff..869040a692e 100644
--- a/modules/boards/spec/features/support/board_new_page.rb
+++ b/modules/boards/spec/features/support/board_new_page.rb
@@ -13,7 +13,7 @@ module Pages
def navigate_by_create_button
visit work_package_boards_path unless page.current_path == work_package_boards_path
- within ".toolbar-items" do
+ within '[data-test-selector="add-board-button"]' do
click_link "Board"
end
end