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 news, activity and cost report

Behrokh Satarnejada528ecbfac9f
diff --git a/app/views/activities/index.html.erb b/app/views/activities/index.html.erb
index 4c5374aa0b1..bf1aaa60526 100644
--- a/app/views/activities/index.html.erb
+++ b/app/views/activities/index.html.erb
@@ -31,7 +31,7 @@ See COPYRIGHT and LICENSE files for more details.
<%=
render Primer::OpenProject::PageHeader.new do |header|
- header.with_title { (@author.nil? ? t(:label_activity) : t(:label_user_activity, value: link_to_user(@author))) }
+ header.with_title { (@author.nil? ? t(:label_activity) : t(:label_user_activity, value: link_to_user(@author))).html_safe }
header.with_breadcrumbs([{ href: home_path, text: organization_name},
*([href: project_overview_path(@project.id), text: @project.name] if @project),
t(:label_activity)])
diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb
index 61998694372..59cd801d4d7 100644
--- a/app/views/news/index.html.erb
+++ b/app/views/news/index.html.erb
@@ -46,6 +46,7 @@ See COPYRIGHT and LICENSE files for more details.
title: I18n.t(:label_work_package_status_new),
tag: :a,
id: 'new_news_link',
+ data: { "test-selector": "add-news-button"},
href: new_project_news_path(@project)) do |button|
button.with_leading_visual_icon(icon: :plus)
t(:label_news_singular)
diff --git a/modules/reporting/spec/features/me_value_spec.rb b/modules/reporting/spec/features/me_value_spec.rb
index 0fa670edfd1..91a6f774cef 100644
--- a/modules/reporting/spec/features/me_value_spec.rb
+++ b/modules/reporting/spec/features/me_value_spec.rb
@@ -39,7 +39,7 @@ RSpec.describe "Cost report showing my own times", :js do
check "query_is_public"
find_by_id("query-icon-save-button").click
# wait until the save is complete
- expect(page).to have_css("h2", text: "Query ME value")
+ expect(page).to have_css(".PageHeader-title", text: "Query ME value")
expect(page).to have_css(".report", text: "10.00")
diff --git a/spec/features/news/creation_and_commenting_spec.rb b/spec/features/news/creation_and_commenting_spec.rb
index f8bce735d95..d97564a37e8 100644
--- a/spec/features/news/creation_and_commenting_spec.rb
+++ b/spec/features/news/creation_and_commenting_spec.rb
@@ -46,9 +46,7 @@ RSpec.describe "News creation and commenting", :js, :with_cuprite do
it "allows creating new and commenting it all of which will result in notifications and mails" do
visit project_news_index_path(project)
- within ".toolbar-items" do
- click_link "News"
- end
+ find('[data-test-selector="add-news-button"]', text: "News").click
# Create the news
fill_in "Title", with: "My new news"