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

Merge remote-tracking branch 'origin/44516-date-alert-enterprise-page' into dev

Oliver Günther1ebb722a3d87
diff --cc spec/features/notifications/notification_center/notification_center_date_alerts_spec.rb
index 77f85d2283c,97ebba2020f..f5e91e8e642
--- a/spec/features/notifications/notification_center/notification_center_date_alerts_spec.rb
+++ b/spec/features/notifications/notification_center/notification_center_date_alerts_spec.rb
@@@ -176,55 -174,56 +174,67 @@@ describe "Notification center date aler
visit notifications_center_path
end
- it 'shows the date alerts according to specification' do
- center.expect_item(notification_wp_start_past, 'Start date was 1 day ago')
- center.expect_item(notification_wp_start_future, 'Start date is in 7 days')
+ context 'without date alerts ee' do
+ it 'shows the upsale page' do
+ side_menu.click_item 'Date alert'
- center.expect_item(notification_wp_due_past, 'Overdue since 3 days')
- center.expect_item(notification_wp_due_future, 'Finish date is in 3 days')
+ expect(page).to have_current_path /notifications\/date_alerts/
+ expect(page).to have_text 'Date alerts is an Enterprise'
+ expect(page).to have_text 'Please upgrade to a paid plan '
+ end
+ end
+
+ context 'with date alerts ee', with_ee: %i[date_alerts] do
+ it 'shows the date alerts according to specification' do
+ center.expect_item(notification_wp_start_past, 'Start date was 1 day ago')
+ center.expect_item(notification_wp_start_future, 'Start date is in 7 days')
- center.expect_item(notification_milestone_past, 'Overdue since 2 days')
- center.expect_item(notification_milestone_future, 'Milestone date is in 1 day')
+ center.expect_item(notification_wp_due_past, 'Overdue since 3 days')
+ center.expect_item(notification_wp_due_future, 'Finish date is in 3 days')
- center.expect_item(notification_wp_unset_date, 'Finish date is deleted')
+ center.expect_item(notification_milestone_past, 'Overdue since 2 days')
+ center.expect_item(notification_milestone_future, 'Milestone date is in 1 day')
- center.expect_item(notification_wp_due_today, 'Finish date is today')
+ center.expect_item(notification_wp_unset_date, 'Finish date is deleted')
- # Doesn't show the date alert for the mention, not the alert
- center.expect_item(notification_wp_double_mention, /(seconds|minutes) ago by Anonymous/)
- center.expect_no_item(notification_wp_double_date_alert)
+ center.expect_item(notification_wp_due_today, 'Finish date is today')
- # When switch to date alerts, it shows the alert, no longer the mention
- side_menu.click_item 'Date alert'
- center.expect_item(notification_wp_double_date_alert, 'Finish date is in 1 day')
- center.expect_no_item(notification_wp_double_mention)
+ # Doesn't show the date alert for the mention, not the alert
+ center.expect_item(notification_wp_double_mention, /(seconds|minutes) ago by Anonymous/)
+ center.expect_no_item(notification_wp_double_date_alert)
- # Ensure that start is created later than due for implicit ID sorting
- double_alert_start, double_alert_due = notification_wp_double_alerts
- expect(double_alert_start.id).to be > double_alert_due.id
+ # When switch to date alerts, it shows the alert, no longer the mention
+ side_menu.click_item 'Date alert'
+ center.expect_item(notification_wp_double_date_alert, 'Finish date is in 1 day')
+ center.expect_no_item(notification_wp_double_mention)
- # We see that start is actually the newest ID, hence shown as the primary notification
- # but the date alert still shows the finish date
- center.expect_item(double_alert_start, 'Finish date is in 1 day')
- center.expect_no_item(double_alert_due)
+ # Ensure that start is created later than due for implicit ID sorting
+ double_alert_start, double_alert_due = notification_wp_double_alerts
+ expect(double_alert_start.id).to be > double_alert_due.id
+
+ # We see that start is actually the newest ID, hence shown as the primary notification
+ # but the date alert still shows the finish date
+ center.expect_item(double_alert_start, 'Finish date is in 1 day')
+ center.expect_no_item(double_alert_due)
- # When a work package is updated to a different date
- wp_double_notification.update_column(:due_date, 5.days.from_now)
- page.driver.refresh
+
+ # Opening a date alert opens in overview
+ center.click_item notification_wp_start_past
+ split_screen = ::Pages::SplitWorkPackage.new wp_start_past
+ split_screen.expect_tab :overview
+
+ # The same is true for the mention item that is opened in date alerts filter
+ center.click_item notification_wp_double_date_alert
+ split_screen = ::Pages::SplitWorkPackage.new wp_double_notification
+ split_screen.expect_tab :overview
+
+ # When a work package is updated to a different date
+ wp_double_notification.update_column(:due_date, 5.days.from_now)
+ page.driver.refresh
- center.expect_item(notification_wp_double_date_alert, 'Finish date is in 5 days')
- center.expect_no_item(notification_wp_double_mention)
+ center.expect_item(notification_wp_double_date_alert, 'Finish date is in 5 days')
+ center.expect_no_item(notification_wp_double_mention)
+ end
end
end
# rubocop:enable RSpec/ScatteredLet