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 calendars

Behrokh Satarnejad031684cd7255
diff --git a/modules/calendar/app/views/calendar/calendars/index.html.erb b/modules/calendar/app/views/calendar/calendars/index.html.erb
index 3c42a940289..36ac02c2396 100644
--- a/modules/calendar/app/views/calendar/calendars/index.html.erb
+++ b/modules/calendar/app/views/calendar/calendars/index.html.erb
@@ -39,7 +39,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-calendar-button"}) do
render Calendar::AddButtonComponent.new(current_project: @project)
end
end
diff --git a/modules/calendar/spec/features/calendars_spec.rb b/modules/calendar/spec/features/calendars_spec.rb
index 2d99967e695..569a95ab5af 100644
--- a/modules/calendar/spec/features/calendars_spec.rb
+++ b/modules/calendar/spec/features/calendars_spec.rb
@@ -80,7 +80,7 @@ RSpec.describe "Work package calendars", :js do
expect(page).to have_text "There is currently nothing to display."
# Open a new calendar from there
- find(".toolbar-item a", text: "Calendar").click
+ find('[data-test-selector="add-calendar-button"]', text: "Calendar").click
loading_indicator_saveguard
diff --git a/modules/calendar/spec/support/pages/calendar.rb b/modules/calendar/spec/support/pages/calendar.rb
index edd71708b69..1f04bb41fc4 100644
--- a/modules/calendar/spec/support/pages/calendar.rb
+++ b/modules/calendar/spec/support/pages/calendar.rb
@@ -140,7 +140,7 @@ module Pages
end
def click_on_create_button
- within ".toolbar-items" do
+ within '[data-test-selector="add-calendar-button"]' do
click_link "Calendar"
end
end