0
0
Fork 0
mirror of https://github.com/discourse/discourse.git synced 2026-08-06 13:08:40 +08:00
discourse/spec/system/viewing_sidebar_mobile_spec.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

60 lines
1.3 KiB
Ruby
Vendored

# frozen_string_literal: true
describe "Viewing sidebar mobile", mobile: true do
fab!(:user)
let(:sidebar_dropdown) { PageObjects::Components::SidebarHeaderDropdown.new }
let(:composer) { PageObjects::Components::Composer.new }
before { sign_in(user) }
it "does not display the sidebar by default" do
visit("/latest")
expect(sidebar_dropdown).to be_hidden
end
it "does not display the keyboard shortcuts button" do
visit("/latest")
sidebar_dropdown.click
expect(sidebar_dropdown).to be_visible
expect(sidebar_dropdown).to have_no_keyboard_shortcuts_button
end
it "collapses the sidebar when clicking outside of it" do
visit("/latest")
sidebar_dropdown.click
expect(sidebar_dropdown).to be_visible
sidebar_dropdown.click_outside
expect(sidebar_dropdown).to be_hidden
end
it "collapses the sidebar when clicking on a link in the sidebar" do
visit("/latest")
sidebar_dropdown.click
expect(sidebar_dropdown).to be_visible
sidebar_dropdown.click_topics_link
expect(sidebar_dropdown).to be_hidden
end
it "collapses the sidebar when clicking on a button in the sidebar" do
visit("/latest")
sidebar_dropdown.click
expect(sidebar_dropdown).to be_visible
sidebar_dropdown.click_categories_header_button
expect(sidebar_dropdown).to be_hidden
end
end