discourse/spec/system/viewing_sidebar_mobile_spec.rb
Alan Guo Xiang Tan ab053ac669
UX: Remove section heading for community section (#22405)
Why is this change being made?

We've decided that the previous "community" section should look more
like a primary section that holds the most important navigation links
for the site and the word "community" doesn't quite fit that
description. Therefore, we've made the decision to drop the
section heading for the community section. 

As part of removing the section heading, the following changes are made
as well:

1. Button to customize the section has been moved to the "footer" of the
   "More..." section when `navigation_menu` site setting is set to `sidebar`. 
   When `navigation_menu` is set to `header dropdown`, a button to customize 
   the section is shown inline.

2. The section will no longer be collapsable.

3. The title of the section is no longer customisable as it is no longer
   displayed. As a technical note, we have not dropped any previous
   customisations of the section's title previously in case we have to
   bring back the header in the future.

4. The new topic button that was previously present in the header has
   been removed alongside the header. Admins can add a custom section
   link to the `/new-topic` route if there would like to make it easier for
   users to create a new topic in the sidebar.
2023-07-11 09:40:37 +08:00

74 lines
1.7 KiB
Ruby

# frozen_string_literal: true
describe "Viewing sidebar mobile", type: :system, mobile: true do
fab!(:user) { Fabricate(: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
it "toggles to desktop view after clicking on the toggle to desktop view button" do
visit ("/latest")
expect(page).to have_css(".mobile-view")
sidebar_dropdown.click
sidebar_dropdown.click_toggle_to_desktop_view_button
visit ("/latest")
expect(page).to have_css(".desktop-view")
end
end