2022-12-22 22:45:29 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module PageObjects
|
|
|
|
module Pages
|
2023-06-14 19:31:28 -04:00
|
|
|
class UserPreferencesNavigationMenu < PageObjects::Pages::Base
|
2022-12-22 22:45:29 -05:00
|
|
|
def visit(user)
|
2023-06-14 19:31:28 -04:00
|
|
|
page.visit("/u/#{user.username}/preferences/navigation-menu")
|
2022-12-22 22:45:29 -05:00
|
|
|
self
|
|
|
|
end
|
|
|
|
|
2023-06-14 19:31:28 -04:00
|
|
|
def has_navigation_menu_categories_preference?(*categories)
|
2022-12-22 22:45:29 -05:00
|
|
|
category_selector_header = page.find(".category-selector .select-kit-header-wrapper")
|
|
|
|
category_selector_header.has_content?(categories.map(&:name).join(", "))
|
|
|
|
end
|
|
|
|
|
2023-06-14 19:31:28 -04:00
|
|
|
def has_navigation_menu_tags_preference?(*tags)
|
2022-12-22 22:45:29 -05:00
|
|
|
tag_selector_header = page.find(".tag-chooser .select-kit-header-wrapper")
|
|
|
|
tag_selector_header.has_content?(tags.map(&:name).join(", "))
|
|
|
|
end
|
|
|
|
|
2023-06-22 12:04:13 -04:00
|
|
|
def has_navigation_menu_preference_checked?(preference)
|
|
|
|
page.find(".#{preference} input").checked?
|
2022-12-22 22:45:29 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|