discourse/spec/system/page_objects/pages/user_preferences_notifications.rb
Régis Hanol c5b32aff76
FEATURE: disable link notification user preference (#35352)
This adds a new notification's user preference to allow users to control
whether they are notified whenever one of their topic is being linked in
another post.

Internal ref - t/160259
2025-10-14 10:53:05 +02:00

31 lines
807 B
Ruby

# frozen_string_literal: true
module PageObjects
module Pages
class UserPreferencesNotifications < PageObjects::Pages::Base
def visit(user)
page.visit("/u/#{user.username}/preferences/notifications")
self
end
def has_notify_on_linked_posts_enabled?
has_css?(".pref-notify-on-linked-posts input[type='checkbox']:checked")
end
def has_notify_on_linked_posts_disabled?
has_css?(".pref-notify-on-linked-posts input[type='checkbox']:not(:checked)")
end
def toggle_notify_on_linked_posts
find(".pref-notify-on-linked-posts input[type='checkbox']").click
self
end
def save_changes
click_button "Save Changes"
expect(page).to have_css(".saved")
self
end
end
end
end