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

fixed custom_actions_spec

Jonas Jabari05c6a887d4bd
diff --git a/spec/features/work_packages/custom_actions/custom_actions_spec.rb b/spec/features/work_packages/custom_actions/custom_actions_spec.rb
index 68c77817e7a..67aceca4f77 100644
--- a/spec/features/work_packages/custom_actions/custom_actions_spec.rb
+++ b/spec/features/work_packages/custom_actions/custom_actions_spec.rb
@@ -321,25 +321,14 @@ RSpec.describe "Custom actions", :js, :with_cuprite,
wp_page.click_custom_action("Unassign")
wp_page.expect_attributes assignee: "-"
activity_tab.expect_journal_details_header(text: user.name)
- # within ".work-package-details-activities-list" do
- # expect(page)
- # .to have_css(".op-user-activity .op-user-activity--user-name",
- # text: user.name,
- # wait: 10)
- # end
wp_page.click_custom_action("Escalate")
wp_page.expect_attributes priority: immediate_priority.name,
status: default_status.name,
assignee: "-",
"customField#{list_custom_field.id}" => selected_list_custom_field_options.map(&:name).join("\n")
- # within ".work-package-details-activities-list" do
- # expect(page)
- # .to have_css(".op-user-activity a.user-mention",
- # text: other_member_user.name,
- # wait: 10)
- # end
- activity_tab.expect_journal_details_header(text: other_member_user.name)
+
+ activity_tab.expect_journal_mention(text: other_member_user.name)
wp_page.click_custom_action("Close")
wp_page.expect_attributes status: closed_status.name,
diff --git a/spec/support/components/work_packages/activities.rb b/spec/support/components/work_packages/activities.rb
index a50fbf017f9..c0c8d0781c3 100644
--- a/spec/support/components/work_packages/activities.rb
+++ b/spec/support/components/work_packages/activities.rb
@@ -101,6 +101,14 @@ module Components
expect(page).to have_test_selector("op-journal-notes-body", text:, wait: 10)
end
+ def expect_journal_mention(text: nil)
+ expect_journal_notes # wait for the notes to be loaded
+
+ page.within_test_selector("op-journal-notes-body") do
+ expect(page).to have_css("a.user-mention", text:, wait: 10)
+ end
+ end
+
def expect_notification_bubble
expect(page).to have_test_selector("op-journal-unread-notification", wait: 10)
end