mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Render glimmer notification items for user notification list (#24802)
This removes the widget notifications list and renders the glimmer user menu notification items instead.
This commit is contained in:
committed by
GitHub
parent
4904c2f11b
commit
223e413a6c
32
spec/system/page_objects/pages/user_notifications.rb
Normal file
32
spec/system/page_objects/pages/user_notifications.rb
Normal file
@@ -0,0 +1,32 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Pages
|
||||
class UserNotifications < PageObjects::Pages::Base
|
||||
def visit(user)
|
||||
page.visit("/u/#{user.username}/notifications")
|
||||
self
|
||||
end
|
||||
|
||||
def filter_dropdown
|
||||
PageObjects::Components::SelectKit.new(".notifications-filter")
|
||||
end
|
||||
|
||||
def set_filter_value(value)
|
||||
filter_dropdown.select_row_by_value(value)
|
||||
end
|
||||
|
||||
def has_selected_filter_value?(value)
|
||||
expect(filter_dropdown).to have_selected_value(value)
|
||||
end
|
||||
|
||||
def has_notification?(notification)
|
||||
page.has_css?(".notification a[href='#{notification.url}']")
|
||||
end
|
||||
|
||||
def has_no_notification?(notification)
|
||||
page.has_no_css?(".notification a[href='#{notification.url}']")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
31
spec/system/user_page/user_notifications_spec.rb
Normal file
31
spec/system/user_page/user_notifications_spec.rb
Normal file
@@ -0,0 +1,31 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
describe "User notifications", type: :system do
|
||||
fab!(:user)
|
||||
let(:user_notifications_page) { PageObjects::Pages::UserNotifications.new }
|
||||
|
||||
fab!(:read_notification) { Fabricate(:notification, user: user, read: true) }
|
||||
fab!(:unread_notification) { Fabricate(:notification, user: user, read: false) }
|
||||
|
||||
before { sign_in(user) }
|
||||
|
||||
describe "filtering" do
|
||||
it "saves custom picture and system assigned pictures" do
|
||||
user_notifications_page.visit(user)
|
||||
user_notifications_page.filter_dropdown
|
||||
expect(user_notifications_page).to have_selected_filter_value("all")
|
||||
expect(user_notifications_page).to have_notification(read_notification)
|
||||
expect(user_notifications_page).to have_notification(unread_notification)
|
||||
|
||||
user_notifications_page.set_filter_value("read")
|
||||
|
||||
expect(user_notifications_page).to have_notification(read_notification)
|
||||
expect(user_notifications_page).to have_no_notification(unread_notification)
|
||||
|
||||
user_notifications_page.set_filter_value("unread")
|
||||
|
||||
expect(user_notifications_page).to have_no_notification(read_notification)
|
||||
expect(user_notifications_page).to have_notification(unread_notification)
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user