mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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.
This commit is contained in:
committed by
GitHub
parent
41c3b42412
commit
ab053ac669
@@ -4,7 +4,7 @@ describe "Custom sidebar sections", type: :system do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:admin) { Fabricate(:admin) }
|
||||
let(:section_modal) { PageObjects::Modals::SidebarSectionForm.new }
|
||||
let(:sidebar) { PageObjects::Components::Sidebar.new }
|
||||
let(:sidebar) { PageObjects::Components::NavigationMenu::Sidebar.new }
|
||||
|
||||
before { user.user_option.update!(external_links_in_new_tab: true) }
|
||||
|
||||
@@ -112,24 +112,36 @@ describe "Custom sidebar sections", type: :system do
|
||||
|
||||
it "allows the user to reorder links in custom section" do
|
||||
sidebar_section = Fabricate(:sidebar_section, title: "My section", user: user)
|
||||
sidebar_url_1 = Fabricate(:sidebar_url, name: "Sidebar Tags", value: "/tags")
|
||||
Fabricate(:sidebar_section_link, sidebar_section: sidebar_section, linkable: sidebar_url_1)
|
||||
sidebar_url_2 = Fabricate(:sidebar_url, name: "Sidebar Categories", value: "/categories")
|
||||
Fabricate(:sidebar_section_link, sidebar_section: sidebar_section, linkable: sidebar_url_2)
|
||||
|
||||
sidebar_url_1 =
|
||||
Fabricate(:sidebar_url, name: "Sidebar Tags", value: "/tags").tap do |sidebar_url|
|
||||
Fabricate(:sidebar_section_link, sidebar_section: sidebar_section, linkable: sidebar_url)
|
||||
end
|
||||
|
||||
sidebar_url_2 =
|
||||
Fabricate(:sidebar_url, name: "Sidebar Categories", value: "/categories").tap do |sidebar_url|
|
||||
Fabricate(:sidebar_section_link, sidebar_section: sidebar_section, linkable: sidebar_url)
|
||||
end
|
||||
|
||||
sidebar_url_3 =
|
||||
Fabricate(:sidebar_url, name: "Sidebar Latest", value: "/latest").tap do |sidebar_url|
|
||||
Fabricate(:sidebar_section_link, sidebar_section: sidebar_section, linkable: sidebar_url)
|
||||
end
|
||||
|
||||
sign_in user
|
||||
|
||||
visit("/latest")
|
||||
|
||||
expect(sidebar.primary_section_links("my-section")).to eq(
|
||||
["Sidebar Tags", "Sidebar Categories"],
|
||||
["Sidebar Tags", "Sidebar Categories", "Sidebar Latest"],
|
||||
)
|
||||
|
||||
tags_link = find(".sidebar-section-link[data-link-name='Sidebar Tags']")
|
||||
categories_link = find(".sidebar-section-link[data-link-name='Sidebar Categories']")
|
||||
tags_link.drag_to(categories_link, html5: true, delay: 0.4)
|
||||
latest_link = find(".sidebar-section-link[data-link-name='Sidebar Latest']")
|
||||
tags_link.drag_to(latest_link, html5: true, delay: 0.4)
|
||||
|
||||
expect(sidebar.primary_section_links("my-section")).to eq(
|
||||
["Sidebar Categories", "Sidebar Tags"],
|
||||
["Sidebar Categories", "Sidebar Tags", "Sidebar Latest"],
|
||||
)
|
||||
end
|
||||
|
||||
@@ -199,40 +211,6 @@ describe "Custom sidebar sections", type: :system do
|
||||
expect(sidebar).to have_no_section("Edited public section")
|
||||
end
|
||||
|
||||
it "allows admin to edit community section and reset to default" do
|
||||
sign_in admin
|
||||
visit("/latest")
|
||||
|
||||
expect(sidebar.primary_section_icons("community")).to eq(
|
||||
%w[layer-group user flag wrench ellipsis-v],
|
||||
)
|
||||
|
||||
sidebar.edit_custom_section("Community")
|
||||
section_modal.fill_link("Topics", "/latest", "paper-plane")
|
||||
section_modal.fill_name("Edited community section")
|
||||
section_modal.topics_link.drag_to(section_modal.review_link, delay: 0.4)
|
||||
section_modal.save
|
||||
|
||||
expect(sidebar).to have_section("Edited community section")
|
||||
expect(sidebar.primary_section_links("edited-community-section")).to eq(
|
||||
["My Posts", "Topics", "Review", "Admin", "More"],
|
||||
)
|
||||
expect(sidebar.primary_section_icons("edited-community-section")).to eq(
|
||||
%w[user paper-plane flag wrench ellipsis-v],
|
||||
)
|
||||
|
||||
sidebar.edit_custom_section("Edited community section")
|
||||
section_modal.reset
|
||||
|
||||
expect(sidebar).to have_section("Community")
|
||||
expect(sidebar.primary_section_links("community")).to eq(
|
||||
["Topics", "My Posts", "Review", "Admin", "More"],
|
||||
)
|
||||
expect(sidebar.primary_section_icons("community")).to eq(
|
||||
%w[layer-group user flag wrench ellipsis-v],
|
||||
)
|
||||
end
|
||||
|
||||
it "shows anonymous public sections" do
|
||||
sidebar_section = Fabricate(:sidebar_section, title: "Public section", public: true)
|
||||
sidebar_url_1 = Fabricate(:sidebar_url, name: "Sidebar Tags", value: "/tags")
|
||||
|
||||
@@ -19,7 +19,7 @@ RSpec.describe "Editing sidebar categories navigation", type: :system do
|
||||
Fabricate(:category, parent_category_id: category.id, name: "category subcategory")
|
||||
end
|
||||
|
||||
let(:sidebar) { PageObjects::Components::Sidebar.new }
|
||||
let(:sidebar) { PageObjects::Components::NavigationMenu::Sidebar.new }
|
||||
|
||||
before { sign_in(user) }
|
||||
|
||||
|
||||
67
spec/system/editing_sidebar_community_section_spec.rb
Normal file
67
spec/system/editing_sidebar_community_section_spec.rb
Normal file
@@ -0,0 +1,67 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
RSpec.describe "Editing Sidebar Community Section", type: :system do
|
||||
fab!(:admin) { Fabricate(:admin) }
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
|
||||
let(:sidebar) { PageObjects::Components::NavigationMenu::Sidebar.new }
|
||||
let(:sidebar_header_dropdown) { PageObjects::Components::NavigationMenu::HeaderDropdown.new }
|
||||
|
||||
it "should not display the edit section button to non admins" do
|
||||
sign_in(user)
|
||||
|
||||
visit("/latest")
|
||||
|
||||
sidebar.click_community_section_more_button
|
||||
|
||||
expect(sidebar).to have_no_customize_community_section_button
|
||||
end
|
||||
|
||||
it "allows admin to edit community section and reset to default" do
|
||||
sign_in(admin)
|
||||
|
||||
visit("/latest")
|
||||
|
||||
expect(sidebar.primary_section_icons("community")).to eq(
|
||||
%w[layer-group user flag wrench ellipsis-v],
|
||||
)
|
||||
|
||||
modal = sidebar.click_community_section_more_button.click_customize_community_section_button
|
||||
modal.fill_link("Topics", "/latest", "paper-plane")
|
||||
modal.topics_link.drag_to(modal.review_link, delay: 0.4)
|
||||
modal.save
|
||||
|
||||
expect(sidebar.primary_section_links("community")).to eq(
|
||||
["My Posts", "Topics", "Review", "Admin", "More"],
|
||||
)
|
||||
|
||||
expect(sidebar.primary_section_icons("community")).to eq(
|
||||
%w[user paper-plane flag wrench ellipsis-v],
|
||||
)
|
||||
|
||||
modal = sidebar.click_community_section_more_button.click_customize_community_section_button
|
||||
modal.reset
|
||||
|
||||
expect(sidebar).to have_section("Community")
|
||||
|
||||
expect(sidebar.primary_section_links("community")).to eq(
|
||||
["Topics", "My Posts", "Review", "Admin", "More"],
|
||||
)
|
||||
|
||||
expect(sidebar.primary_section_icons("community")).to eq(
|
||||
%w[layer-group user flag wrench ellipsis-v],
|
||||
)
|
||||
end
|
||||
|
||||
it "should allow admins to open modal to edit the section when `navigation_menu` site setting is `header dropdown`" do
|
||||
SiteSetting.navigation_menu = "header dropdown"
|
||||
|
||||
sign_in(admin)
|
||||
|
||||
visit("/latest")
|
||||
|
||||
modal = sidebar_header_dropdown.open.click_customize_community_section_button
|
||||
|
||||
expect(modal).to be_visible
|
||||
end
|
||||
end
|
||||
@@ -24,7 +24,7 @@ RSpec.describe "Editing sidebar tags navigation", type: :system do
|
||||
# This tag should not be displayed in the modal as it has not been used in a topic
|
||||
fab!(:tag5) { Fabricate(:tag, name: "tag5") }
|
||||
|
||||
let(:sidebar) { PageObjects::Components::Sidebar.new }
|
||||
let(:sidebar) { PageObjects::Components::NavigationMenu::Sidebar.new }
|
||||
|
||||
before { sign_in(user) }
|
||||
|
||||
|
||||
129
spec/system/page_objects/components/navigation_menu/base.rb
Normal file
129
spec/system/page_objects/components/navigation_menu/base.rb
Normal file
@@ -0,0 +1,129 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Components
|
||||
module NavigationMenu
|
||||
class Base < PageObjects::Components::Base
|
||||
def community_section
|
||||
find(".sidebar-section[data-section-name='community']")
|
||||
end
|
||||
|
||||
SIDEBAR_SECTION_LINK_SELECTOR = "sidebar-section-link"
|
||||
|
||||
def click_section_link(name)
|
||||
find(".#{SIDEBAR_SECTION_LINK_SELECTOR}", text: name).click
|
||||
end
|
||||
|
||||
def has_one_active_section_link?
|
||||
has_css?(".#{SIDEBAR_SECTION_LINK_SELECTOR}--active", count: 1)
|
||||
end
|
||||
|
||||
def has_section_link?(name, href: nil, active: false, target: nil)
|
||||
section_link_present?(name, href: href, active: active, target: target, present: true)
|
||||
end
|
||||
|
||||
def has_no_section_link?(name, href: nil, active: false)
|
||||
section_link_present?(name, href: href, active: active, present: false)
|
||||
end
|
||||
def has_section?(name)
|
||||
has_css?(".sidebar-sections [data-section-name='#{name.parameterize}']")
|
||||
end
|
||||
|
||||
def has_no_section?(name)
|
||||
has_no_css?(".sidebar-sections [data-section-name='#{name.parameterize}']")
|
||||
end
|
||||
|
||||
def has_categories_section?
|
||||
has_section?("Categories")
|
||||
end
|
||||
|
||||
def has_tags_section?
|
||||
has_section?("Tags")
|
||||
end
|
||||
|
||||
def has_no_tags_section?
|
||||
has_no_section?("Tags")
|
||||
end
|
||||
|
||||
def has_all_tags_section_link?
|
||||
has_section_link?(I18n.t("js.sidebar.all_tags"))
|
||||
end
|
||||
|
||||
def has_tag_section_links?(tags)
|
||||
tag_names = tags.map(&:name)
|
||||
|
||||
tag_section_links =
|
||||
all(
|
||||
".sidebar-section[data-section-name='tags'] .sidebar-section-link-wrapper[data-tag-name]",
|
||||
count: tag_names.length,
|
||||
)
|
||||
|
||||
expect(tag_section_links.map(&:text)).to eq(tag_names)
|
||||
end
|
||||
|
||||
def primary_section_links(slug)
|
||||
all("[data-section-name='#{slug}'] .sidebar-section-link-wrapper").map(&:text)
|
||||
end
|
||||
|
||||
def primary_section_icons(slug)
|
||||
all("[data-section-name='#{slug}'] .sidebar-section-link-wrapper use").map do |icon|
|
||||
icon[:href].delete_prefix("#")
|
||||
end
|
||||
end
|
||||
|
||||
def has_category_section_link?(category)
|
||||
page.has_link?(category.name, class: "sidebar-section-link")
|
||||
end
|
||||
|
||||
def click_add_section_button
|
||||
click_button(add_section_button_text)
|
||||
end
|
||||
|
||||
def has_no_add_section_button?
|
||||
page.has_no_button?(add_section_button_text)
|
||||
end
|
||||
|
||||
def click_edit_categories_button
|
||||
within(".sidebar-section[data-section-name='categories']") do
|
||||
click_button(class: "sidebar-section-header-button", visible: false)
|
||||
end
|
||||
|
||||
PageObjects::Modals::SidebarEditCategories.new
|
||||
end
|
||||
|
||||
def click_edit_tags_button
|
||||
within(".sidebar-section[data-section-name='tags']") do
|
||||
click_button(class: "sidebar-section-header-button", visible: false)
|
||||
end
|
||||
|
||||
PageObjects::Modals::SidebarEditTags.new
|
||||
end
|
||||
|
||||
def edit_custom_section(name)
|
||||
name = name.parameterize
|
||||
|
||||
find(".sidebar-section[data-section-name='#{name}']").hover
|
||||
|
||||
find(
|
||||
".sidebar-section[data-section-name='#{name}'] button.sidebar-section-header-button",
|
||||
).click
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def section_link_present?(name, href: nil, active: false, target: nil, present:)
|
||||
attributes = { exact_text: name }
|
||||
attributes[:href] = href if href
|
||||
attributes[:class] = SIDEBAR_SECTION_LINK_SELECTOR
|
||||
attributes[:class] += "--active" if active
|
||||
attributes[:target] = target if target
|
||||
page.public_send(present ? :has_link? : :has_no_link?, **attributes)
|
||||
end
|
||||
|
||||
def add_section_button_text
|
||||
I18n.t("js.sidebar.sections.custom.add")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,25 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Components
|
||||
module NavigationMenu
|
||||
class HeaderDropdown < Base
|
||||
def open
|
||||
find(".header-dropdown-toggle.hamburger-dropdown").click
|
||||
expect(page).to have_css(".sidebar-hamburger-dropdown")
|
||||
self
|
||||
end
|
||||
|
||||
def click_customize_community_section_button
|
||||
community_section.click_button(
|
||||
I18n.t("js.sidebar.sections.community.edit_section.header_dropdown"),
|
||||
)
|
||||
|
||||
expect(page).to have_no_css(".sidebar-hamburger-dropdown")
|
||||
|
||||
PageObjects::Modals::SidebarSectionForm.new
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,45 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Components
|
||||
module NavigationMenu
|
||||
class Sidebar < Base
|
||||
def open_on_mobile
|
||||
click_button("toggle-hamburger-menu")
|
||||
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?(class: "sidebar-section-link-button")
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -1,138 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Components
|
||||
class Sidebar < PageObjects::Components::Base
|
||||
def open_on_mobile
|
||||
click_button("toggle-hamburger-menu")
|
||||
end
|
||||
|
||||
def visible?
|
||||
page.has_css?("#d-sidebar")
|
||||
end
|
||||
|
||||
def not_visible?
|
||||
page.has_no_css?("#d-sidebar")
|
||||
end
|
||||
|
||||
def has_category_section_link?(category)
|
||||
page.has_link?(category.name, class: "sidebar-section-link")
|
||||
end
|
||||
|
||||
def click_add_section_button
|
||||
click_button(add_section_button_text)
|
||||
end
|
||||
|
||||
def has_no_add_section_button?
|
||||
page.has_no_button?(add_section_button_text)
|
||||
end
|
||||
|
||||
def click_edit_categories_button
|
||||
within(".sidebar-section[data-section-name='categories']") do
|
||||
click_button(class: "sidebar-section-header-button", visible: false)
|
||||
end
|
||||
|
||||
PageObjects::Modals::SidebarEditCategories.new
|
||||
end
|
||||
|
||||
def click_edit_tags_button
|
||||
within(".sidebar-section[data-section-name='tags']") do
|
||||
click_button(class: "sidebar-section-header-button", visible: false)
|
||||
end
|
||||
|
||||
PageObjects::Modals::SidebarEditTags.new
|
||||
end
|
||||
|
||||
def edit_custom_section(name)
|
||||
find(".sidebar-section[data-section-name='#{name.parameterize}']").hover
|
||||
|
||||
find(
|
||||
".sidebar-section[data-section-name='#{name.parameterize}'] button.sidebar-section-header-button",
|
||||
).click
|
||||
end
|
||||
|
||||
SIDEBAR_SECTION_LINK_SELECTOR = "sidebar-section-link"
|
||||
|
||||
def click_section_link(name)
|
||||
find(".#{SIDEBAR_SECTION_LINK_SELECTOR}", text: name).click
|
||||
end
|
||||
|
||||
def has_one_active_section_link?
|
||||
has_css?(".#{SIDEBAR_SECTION_LINK_SELECTOR}--active", count: 1)
|
||||
end
|
||||
|
||||
def has_section_link?(name, href: nil, active: false, target: nil)
|
||||
section_link_present?(name, href: href, active: active, target: target, present: true)
|
||||
end
|
||||
|
||||
def has_no_section_link?(name, href: nil, active: false)
|
||||
section_link_present?(name, href: href, active: active, present: false)
|
||||
end
|
||||
|
||||
def custom_section_modal_title
|
||||
find("#discourse-modal-title")
|
||||
end
|
||||
|
||||
def has_section?(name)
|
||||
has_css?(".sidebar-sections [data-section-name='#{name.parameterize}']")
|
||||
end
|
||||
|
||||
def has_no_section?(name)
|
||||
has_no_css?(".sidebar-sections [data-section-name='#{name.parameterize}']")
|
||||
end
|
||||
|
||||
def has_categories_section?
|
||||
has_section?("Categories")
|
||||
end
|
||||
|
||||
def has_tags_section?
|
||||
has_section?("Tags")
|
||||
end
|
||||
|
||||
def has_no_tags_section?
|
||||
has_no_section?("Tags")
|
||||
end
|
||||
|
||||
def has_all_tags_section_link?
|
||||
has_section_link?(I18n.t("js.sidebar.all_tags"))
|
||||
end
|
||||
|
||||
def has_tag_section_links?(tags)
|
||||
tag_names = tags.map(&:name)
|
||||
|
||||
tag_section_links =
|
||||
all(
|
||||
".sidebar-section[data-section-name='tags'] .sidebar-section-link-wrapper[data-tag-name]",
|
||||
count: tag_names.length,
|
||||
)
|
||||
|
||||
expect(tag_section_links.map(&:text)).to eq(tag_names)
|
||||
end
|
||||
|
||||
def primary_section_links(slug)
|
||||
all("[data-section-name='#{slug}'] .sidebar-section-link-wrapper").map(&:text)
|
||||
end
|
||||
|
||||
def primary_section_icons(slug)
|
||||
all("[data-section-name='#{slug}'] .sidebar-section-link-wrapper use").map do |icon|
|
||||
icon[:href].delete_prefix("#")
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def section_link_present?(name, href: nil, active: false, target: nil, present:)
|
||||
attributes = { exact_text: name }
|
||||
attributes[:href] = href if href
|
||||
attributes[:class] = SIDEBAR_SECTION_LINK_SELECTOR
|
||||
attributes[:class] += "--active" if active
|
||||
attributes[:target] = target if target
|
||||
page.public_send(present ? :has_link? : :has_no_link?, **attributes)
|
||||
end
|
||||
|
||||
def add_section_button_text
|
||||
I18n.t("js.sidebar.sections.custom.add")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -23,9 +23,9 @@ module PageObjects
|
||||
page.has_no_css?(".sidebar-footer-actions-keyboard-shortcuts")
|
||||
end
|
||||
|
||||
def click_community_header_button
|
||||
def click_categories_header_button
|
||||
page.click_button(
|
||||
I18n.t("js.sidebar.sections.community.header_action_create_topic_title"),
|
||||
I18n.t("js.sidebar.sections.categories.header_action_title"),
|
||||
class: "sidebar-section-header-button",
|
||||
)
|
||||
end
|
||||
|
||||
@@ -34,16 +34,24 @@ module PageObjects
|
||||
def reset
|
||||
find(".reset-link").click
|
||||
find(".dialog-footer .btn-primary").click
|
||||
closed?
|
||||
self
|
||||
end
|
||||
|
||||
def save
|
||||
find("#save-section").click
|
||||
closed?
|
||||
self
|
||||
end
|
||||
|
||||
def visible?
|
||||
page.has_css?(".sidebar-section-form-modal")
|
||||
end
|
||||
|
||||
def closed?
|
||||
page.has_no_css?(".sidebar-section-form-modal")
|
||||
end
|
||||
|
||||
def has_disabled_save?
|
||||
find_button("Save", disabled: true)
|
||||
end
|
||||
|
||||
@@ -25,7 +25,7 @@ describe "Viewing sidebar as anonymous user", type: :system do
|
||||
Fabricate(:tag, name: "tag 6").tap { |tag| Fabricate.times(1, :topic, tags: [tag]) }
|
||||
end
|
||||
|
||||
let(:sidebar) { PageObjects::Components::Sidebar.new }
|
||||
let(:sidebar) { PageObjects::Components::NavigationMenu::Sidebar.new }
|
||||
|
||||
describe "when viewing the tags section" do
|
||||
it "should not display the tags section when tagging has been disabled" do
|
||||
|
||||
@@ -53,9 +53,8 @@ describe "Viewing sidebar mobile", type: :system, mobile: true do
|
||||
|
||||
expect(sidebar_dropdown).to be_visible
|
||||
|
||||
sidebar_dropdown.click_community_header_button
|
||||
sidebar_dropdown.click_categories_header_button
|
||||
|
||||
expect(composer).to be_opened
|
||||
expect(sidebar_dropdown).to be_hidden
|
||||
end
|
||||
|
||||
|
||||
@@ -5,6 +5,8 @@ describe "Viewing sidebar", type: :system do
|
||||
fab!(:user) { Fabricate(:user) }
|
||||
fab!(:category_sidebar_section_link) { Fabricate(:category_sidebar_section_link, user: user) }
|
||||
|
||||
let(:sidebar) { PageObjects::Components::NavigationMenu::Sidebar.new }
|
||||
|
||||
before { sign_in(user) }
|
||||
|
||||
describe "when using the legacy navigation menu" do
|
||||
@@ -13,8 +15,6 @@ describe "Viewing sidebar", type: :system do
|
||||
it "should display the sidebar when `navigation_menu` query param is 'sidebar'" do
|
||||
visit("/latest?navigation_menu=sidebar")
|
||||
|
||||
sidebar = PageObjects::Components::Sidebar.new
|
||||
|
||||
expect(sidebar).to be_visible
|
||||
expect(sidebar).to have_category_section_link(category_sidebar_section_link.linkable)
|
||||
expect(page).not_to have_css(".hamburger-dropdown")
|
||||
@@ -23,8 +23,6 @@ describe "Viewing sidebar", type: :system do
|
||||
it "should display the sidebar dropdown menu when `navigation_menu` query param is 'header_dropdown'" do
|
||||
visit("/latest?navigation_menu=header_dropdown")
|
||||
|
||||
sidebar = PageObjects::Components::Sidebar.new
|
||||
|
||||
expect(sidebar).to be_not_visible
|
||||
|
||||
header_dropdown = PageObjects::Components::SidebarHeaderDropdown.new
|
||||
@@ -40,8 +38,6 @@ describe "Viewing sidebar", type: :system do
|
||||
it "should display the sidebar when `navigation_menu` query param is 'sidebar'" do
|
||||
visit("/latest?navigation_menu=sidebar")
|
||||
|
||||
sidebar = PageObjects::Components::Sidebar.new
|
||||
|
||||
expect(sidebar).to be_visible
|
||||
expect(page).not_to have_css(".hamburger-dropdown")
|
||||
end
|
||||
@@ -49,8 +45,6 @@ describe "Viewing sidebar", type: :system do
|
||||
it "should display the legacy dropdown menu when `navigation_menu` query param is 'legacy'" do
|
||||
visit("/latest?navigation_menu=legacy")
|
||||
|
||||
sidebar = PageObjects::Components::Sidebar.new
|
||||
|
||||
expect(sidebar).to be_not_visible
|
||||
|
||||
legacy_header_dropdown = PageObjects::Components::LegacyHeaderDropdown.new
|
||||
@@ -66,8 +60,6 @@ describe "Viewing sidebar", type: :system do
|
||||
it "should display the legacy dropdown menu when `navigation_menu` query param is 'legacy'" do
|
||||
visit("/latest?navigation_menu=legacy")
|
||||
|
||||
sidebar = PageObjects::Components::Sidebar.new
|
||||
|
||||
expect(sidebar).to be_not_visible
|
||||
|
||||
legacy_header_dropdown = PageObjects::Components::LegacyHeaderDropdown.new
|
||||
@@ -79,8 +71,6 @@ describe "Viewing sidebar", type: :system do
|
||||
it "should display the sidebar dropdown menu when `navigation_menu` query param is 'header_dropdown'" do
|
||||
visit("/latest?navigation_menu=header_dropdown")
|
||||
|
||||
sidebar = PageObjects::Components::Sidebar.new
|
||||
|
||||
expect(sidebar).to be_not_visible
|
||||
|
||||
header_dropdown = PageObjects::Components::SidebarHeaderDropdown.new
|
||||
|
||||
Reference in New Issue
Block a user