mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 06:13:42 +08:00
51 lines
1.3 KiB
Ruby
51 lines
1.3 KiB
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Components
|
|
module NavigationMenu
|
|
class Sidebar < Base
|
|
def open_on_mobile
|
|
click_button("toggle-hamburger-menu")
|
|
wait_for_animation(find("div.menu-panel"))
|
|
end
|
|
|
|
def visible?
|
|
page.has_css?("#d-sidebar")
|
|
end
|
|
|
|
def not_visible?
|
|
page.has_no_css?("#d-sidebar")
|
|
end
|
|
|
|
def has_no_customize_community_section_button?
|
|
community_section.has_no_button?('[data-list-item-name="customize"]')
|
|
end
|
|
|
|
def click_customize_community_section_button
|
|
community_section.click_button(
|
|
I18n.t("js.sidebar.sections.community.edit_section.sidebar"),
|
|
)
|
|
|
|
expect(community_section).to have_no_css(".sidebar-more-section-links-details")
|
|
|
|
PageObjects::Modals::SidebarSectionForm.new
|
|
end
|
|
|
|
def click_community_section_more_button
|
|
community_section.click_button(class: "sidebar-more-section-links-details-summary")
|
|
expect(community_section).to have_css(".sidebar-more-section-links-details")
|
|
self
|
|
end
|
|
|
|
def custom_section_modal_title
|
|
find("#discourse-modal-title")
|
|
end
|
|
|
|
def toggle_all_sections
|
|
find(".sidebar-toggle-all-sections").click
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|