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

a test to check updating html title while opening and closing split view

bsatarnejadc0e47059e934
diff --git a/spec/features/notifications/notification_center/split_screen_spec.rb b/spec/features/notifications/notification_center/split_screen_spec.rb
index 3d7c3c04c59..7e376b2498e 100644
--- a/spec/features/notifications/notification_center/split_screen_spec.rb
+++ b/spec/features/notifications/notification_center/split_screen_spec.rb
@@ -1,6 +1,7 @@
require 'spec_helper'
describe "Split screen in the notification center", type: :feature, js: true do
+ let(:global_html_title) { ::Components::HtmlTitle.new }
shared_let(:project) { FactoryBot.create :project }
shared_let(:work_package) { FactoryBot.create :work_package, project: project }
shared_let(:second_work_package) { FactoryBot.create :work_package, project: project }
@@ -81,6 +82,28 @@ describe "Split screen in the notification center", type: :feature, js: true do
split_screen.close
split_screen.expect_empty_state
end
+
+ it 'should show the correct html title while opening and closing the split view' do
+ global_html_title.expect_first_segment 'Notifications'
+
+ # The split view should be opened and html title should change
+ center.click_item notification
+ global_html_title.expect_first_segment "#{work_package.type.name}: #{work_package.subject} (##{work_package.id})"
+
+ # The split view should be closed and html title should change to the previous title
+ split_screen.close
+ global_html_title.expect_first_segment 'Notifications'
+
+ # Html title should be updated with next WP data after making the current one as read
+ center.click_item notification
+ center.mark_notification_as_read notification
+ global_html_title.expect_first_segment "#{second_work_package.type.name}: #{second_work_package.subject} (##{second_work_package.id})"
+
+ # After making all notifications as read, html title should show the base route
+ center.mark_notification_as_read second_notification
+ global_html_title.expect_first_segment 'Notifications'
+
+ end
end
context 'with no unread notification' do