mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-27 08:42:09 +08:00
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.
40 lines
1 KiB
Ruby
Vendored
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
|