discourse/spec/system/page_objects/components/sidebar_header_dropdown.rb
David Taylor 9aa52af4c9
UX: Drop legacy mobile-mode site settings (#40226)
Viewport-based mobile mode has been the default since September, and the
feedback has been overwhelmingly positive. This is now the only
supported method.

`enable_mobile_theme` is an extremely old hidden setting, which doesn't
make sense at all now that almost all Discourse design is
viewport-based.

This commit cleans up both, and all their associated logic/tests. On the
server-side, we standardize any remaining mobile-user-agent logic to be
described as `mobile_device?` instead of `mobile_view?`, so that it has
parity with the client-side `capabilities` service.
2026-05-26 09:23:13 +01:00

40 lines
1 KiB
Ruby
Vendored

# frozen_string_literal: true
module PageObjects
module Components
class SidebarHeaderDropdown < PageObjects::Components::Base
def click
page.find(".hamburger-dropdown").click
wait_for_animation(find(".menu-panel"), timeout: 5)
self
end
SIDEBAR_HAMBURGER_DROPDOWN = ".sidebar-hamburger-dropdown"
def visible?
page.has_css?(SIDEBAR_HAMBURGER_DROPDOWN)
end
def hidden?
page.has_no_css?(SIDEBAR_HAMBURGER_DROPDOWN)
end
def has_no_keyboard_shortcuts_button?
page.has_no_css?(".sidebar-footer-actions-keyboard-shortcuts")
end
def click_categories_header_button
page.find("[data-section-name='categories'] .sidebar-section-header-button").click
end
def click_topics_link
find(".sidebar-section-link[data-link-name='everything']").click
end
def click_outside
width = page.evaluate_script("document.body.clientWidth")
page.find("body").click(x: width - 1, y: 1)
end
end
end
end