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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
fixed flaky specs and styling fixes
Jonas Jabari8329d1ba5166
diff --git a/app/components/work_packages/activities_tab/journals/item_component.html.erb b/app/components/work_packages/activities_tab/journals/item_component.html.erbindex 28122035f35..75ea47a133c 100644--- a/app/components/work_packages/activities_tab/journals/item_component.html.erb+++ b/app/components/work_packages/activities_tab/journals/item_component.html.erb@@ -31,7 +31,7 @@header_container.with_column(flex_layout: true, align_items: :center) do |header_end_container|if has_unread_notifications?header_end_container.with_column(mr: 2, pt: 1) do- render(Primer::Beta::Octicon.new(:"dot-fill", color: :accent, size: :medium))+ render(Primer::Beta::Octicon.new(:"dot-fill", color: :accent, size: :medium, data: { test_selector: "op-journal-unread-notification" }))endendheader_end_container.with_column dodiff --git a/app/components/work_packages/activities_tab/journals/item_component/details.rb b/app/components/work_packages/activities_tab/journals/item_component/details.rbindex dc81e4f0e77..9b4f84a61fd 100644--- a/app/components/work_packages/activities_tab/journals/item_component/details.rb+++ b/app/components/work_packages/activities_tab/journals/item_component/details.rb@@ -133,7 +133,10 @@ module WorkPackagesdef render_notification_bubble(container)container.with_column(mr: 2) do- render(Primer::Beta::Octicon.new(:"dot-fill", color: :accent, size: :medium))+ render(Primer::Beta::Octicon.new(+ :"dot-fill", color: :accent, size: :medium,+ data: { test_selector: "op-journal-unread-notification" }+ ))endend@@ -161,7 +164,7 @@ module WorkPackagesdetails_container.with_row(flex_layout: true, pt: 1, pb: 3) do |details_container_inner|if journal.initial?- render_empty_line(details_container_inner) if filter == :only_changes+ details_container.with_row(mb: 3, font_size: :small, classes: "empty-line")elserender_journal_details(details_container_inner)enddiff --git a/spec/features/activities/work_package/activities_spec.rb b/spec/features/activities/work_package/activities_spec.rbindex 54531de1b7f..1e822b5be9d 100644--- a/spec/features/activities/work_package/activities_spec.rb+++ b/spec/features/activities/work_package/activities_spec.rb@@ -150,7 +150,7 @@ RSpec.describe "Work package activity", :js, :with_cuprite, with_flag: { primeriwp_page.wait_for_activity_tabend- it "does show comments and enable adding and quoting comments and editing own comments" do+ it "does show comments but does NOT enable editing other users comments" doactivity_tab.expect_journal_notes(text: "First comment by admin")activity_tab.within_journal_entry(first_comment) do@@ -161,7 +161,9 @@ RSpec.describe "Work package activity", :js, :with_cuprite, with_flag: { primeri# allowed to quote other user's commentsexpect(page).to have_test_selector("op-wp-journal-#{first_comment.id}-quote")end+ end+ it "enable adding and quoting comments and editing OWN comments" doactivity_tab.expect_input_fieldactivity_tab.add_comment(text: "First comment by viewer with commenting permission")@@ -169,9 +171,7 @@ RSpec.describe "Work package activity", :js, :with_cuprite, with_flag: { primerisecond_comment = work_package.journals.reload.lastactivity_tab.within_journal_entry(second_comment) do- # for some reason only opens on the second click in the test- # probably due to the previous click on the first comment- 2.times { page.find_test_selector("op-wp-journal-#{second_comment.id}-action-menu").click }+ page.find_test_selector("op-wp-journal-#{second_comment.id}-action-menu").clickexpect(page).to have_test_selector("op-wp-journal-#{second_comment.id}-edit")expect(page).to have_test_selector("op-wp-journal-#{second_comment.id}-quote")@@ -189,7 +189,7 @@ RSpec.describe "Work package activity", :js, :with_cuprite, with_flag: { primeriwp_page.wait_for_activity_tabend- it "does show comments and enable adding and quoting comments and editing own comments" do+ it "does show comments and enable adding and quoting comments and editing of other users comments" doactivity_tab.expect_journal_notes(text: "First comment by admin")activity_tab.within_journal_entry(first_comment) do@@ -200,21 +200,6 @@ RSpec.describe "Work package activity", :js, :with_cuprite, with_flag: { primeri# allowed to quote other user's commentsexpect(page).to have_test_selector("op-wp-journal-#{first_comment.id}-quote")end-- activity_tab.expect_input_field-- activity_tab.add_comment(text: "First comment by viewer with editing permission")-- second_comment = work_package.journals.reload.last-- activity_tab.within_journal_entry(second_comment) do- # for some reason only opens on the second click in the test- # probably due to the previous click on the first comment- 2.times { page.find_test_selector("op-wp-journal-#{second_comment.id}-action-menu").click }-- expect(page).to have_test_selector("op-wp-journal-#{second_comment.id}-edit")- expect(page).to have_test_selector("op-wp-journal-#{second_comment.id}-quote")- endendendenddiff --git a/spec/support/components/work_packages/activities.rb b/spec/support/components/work_packages/activities.rbindex e093c3290f3..1dd2f9ea317 100644--- a/spec/support/components/work_packages/activities.rb+++ b/spec/support/components/work_packages/activities.rb@@ -100,11 +100,11 @@ module Componentsenddef expect_notification_bubble- expect(page).to have_test_selector("user-activity-bubble")+ expect(page).to have_test_selector("op-journal-unread-notification")enddef expect_no_notification_bubble- expect(page).not_to have_test_selector("user-activity-bubble")+ expect(page).not_to have_test_selector("op-journal-unread-notification")enddef expect_journal_container_at_bottom