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 notification bubble spec

Jonas Jabari678eec64eaed
diff --git a/spec/features/work_packages/tabs/activity_notifications_spec.rb b/spec/features/work_packages/tabs/activity_notifications_spec.rb
index 6d54dba9c59..4ca607a077e 100644
--- a/spec/features/work_packages/tabs/activity_notifications_spec.rb
+++ b/spec/features/work_packages/tabs/activity_notifications_spec.rb
@@ -24,13 +24,16 @@ RSpec.describe "Activity tab notifications", :js, :selenium do
resource: work_package,
journal: work_package.journals.last)
end
+
+ let(:activity_tab) { Components::WorkPackages::Activities.new(work_package) }
+
it "shows a notification bubble with the right number" do
expect(page).to have_test_selector("tab-counter-Activity", text: "1")
end
it "shows a notification icon next to activities that have an unread notification" do
- expect(page).to have_test_selector("user-activity-bubble", count: 1)
- expect(page).to have_css("[data-qa-activity-number='4'] #{test_selector('user-activity-bubble')}")
+ # tested in more detail in the activity tab spec spec/features/activities/work_package/activities_spec.rb
+ activity_tab.expect_notification_bubble
end
it "shows a button to mark the notifications as read" do
@@ -42,17 +45,19 @@ RSpec.describe "Activity tab notifications", :js, :selenium do
# ... and updates the view accordingly
expect(page).not_to have_test_selector("mark-notification-read-button")
expect(page).not_to have_test_selector("tab-counter-Activity")
- expect(page).not_to have_test_selector("user-activity-bubble")
+ activity_tab.expect_no_notification_bubble
end
end
shared_examples_for "when there are no notifications for the work package" do
+ let(:activity_tab) { Components::WorkPackages::Activities.new(work_package) }
+
it "shows no notification bubble" do
expect(page).not_to have_test_selector("tab-counter-Activity")
end
it "does not show any notification icons next to activities" do
- expect(page).not_to have_test_selector("user-activity-bubble")
+ activity_tab.expect_no_notification_bubble
end
it "shows no button to mark the notifications as read" do