2024-05-27 13:49:24 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module PageObjects
|
|
|
|
module Pages
|
|
|
|
class UserPreferencesAi < PageObjects::Pages::Base
|
|
|
|
def visit(user)
|
|
|
|
page.visit("/u/#{user.username}/preferences/ai")
|
|
|
|
self
|
|
|
|
end
|
|
|
|
|
|
|
|
def has_ai_preference_checked?(preference)
|
|
|
|
page.find(".#{preference} input").checked?
|
|
|
|
end
|
|
|
|
|
2024-08-14 13:17:36 -04:00
|
|
|
def has_ai_preference?(preference)
|
|
|
|
page.has_css?(".#{preference} input")
|
|
|
|
end
|
|
|
|
|
|
|
|
def has_no_ai_preference?(preference)
|
|
|
|
page.has_no_css?(".#{preference} input")
|
|
|
|
end
|
|
|
|
|
2024-05-27 13:49:24 -04:00
|
|
|
def toggle_setting(preference)
|
|
|
|
page.find(".#{preference} input").click
|
|
|
|
end
|
|
|
|
|
|
|
|
def save_changes
|
|
|
|
page.find(".save-changes").click
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|