mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Support sub-subcategories in new edit sidebar categories modal (#21994)
Why does this commit do?
This commit adds support for sub-subcategories in the new edit sidebar
categories modal added in fc296b9a81. Note
that sub-subcategories are enabled when `max_category_nesting` is set to
`3`.
This commit is contained in:
committed by
GitHub
parent
699f3e7014
commit
2191b879c6
@@ -53,4 +53,39 @@ RSpec.describe "Editing sidebar categories navigation", type: :system do
|
||||
expect(sidebar).to have_no_section_link(category_subcategory2.name)
|
||||
expect(sidebar).to have_no_section_link(category2.name)
|
||||
end
|
||||
|
||||
describe "when max_category_nesting has been set to 3" do
|
||||
before { SiteSetting.max_category_nesting = 3 }
|
||||
|
||||
it "allows a user to edit sub-subcategories to be included in the sidebar categories section" do
|
||||
category_subcategory_subcategory =
|
||||
Fabricate(:category, parent_category_id: category_subcategory.id)
|
||||
|
||||
category_subcategory_subcategory2 =
|
||||
Fabricate(:category, parent_category_id: category_subcategory.id)
|
||||
|
||||
category2_subcategory_subcategory =
|
||||
Fabricate(:category, parent_category_id: category2_subcategory.id)
|
||||
|
||||
visit "/latest"
|
||||
|
||||
expect(sidebar).to have_categories_section
|
||||
|
||||
modal = sidebar.click_edit_categories_button
|
||||
|
||||
expect(modal).to have_right_title(I18n.t("js.sidebar.categories_form.title"))
|
||||
|
||||
modal
|
||||
.toggle_category_checkbox(category_subcategory_subcategory)
|
||||
.toggle_category_checkbox(category_subcategory_subcategory2)
|
||||
.toggle_category_checkbox(category2_subcategory_subcategory)
|
||||
.save
|
||||
|
||||
expect(modal).to be_closed
|
||||
|
||||
expect(sidebar).to have_section_link(category_subcategory_subcategory.name)
|
||||
expect(sidebar).to have_section_link(category_subcategory_subcategory2.name)
|
||||
expect(sidebar).to have_section_link(category2_subcategory_subcategory.name)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user