mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: expand the admin sidebar when filtering (#27312)
Even when the admin sidebar sections are collapsed, they should expand while filtering. When the filter is removed, sections should go back to the previous state. In addition, trim whitespace from the filter section.
This commit is contained in:
committed by
GitHub
parent
472c02bda8
commit
eebf332025
@@ -105,6 +105,29 @@ describe "Admin Revamp | Sidebar Navigation", type: :system do
|
||||
links = page.all(".sidebar-section-link-content-text")
|
||||
expect(links.count).to eq(3)
|
||||
expect(links.map(&:text)).to eq(["Appearance", "Preview Summary", "Server Setup"])
|
||||
|
||||
filter.filter(" preview ")
|
||||
links = page.all(".sidebar-section-link-content-text")
|
||||
expect(links.count).to eq(1)
|
||||
expect(links.map(&:text)).to eq(["Preview Summary"])
|
||||
expect(page).to have_no_css(".sidebar-no-results")
|
||||
end
|
||||
|
||||
it "temporarily expands section when filter" do
|
||||
visit("/admin")
|
||||
links = page.all(".sidebar-section-link-content-text")
|
||||
expect(links.count).to eq(2)
|
||||
expect(links.map(&:text)).to eq(["Dashboard", "All Site Settings"])
|
||||
|
||||
filter.filter("ie")
|
||||
links = page.all(".sidebar-section-link-content-text")
|
||||
expect(links.count).to eq(2)
|
||||
expect(links.map(&:text)).to eq(["User Fields", "Preview Summary"])
|
||||
|
||||
filter.filter("")
|
||||
links = page.all(".sidebar-section-link-content-text")
|
||||
expect(links.count).to eq(2)
|
||||
expect(links.map(&:text)).to eq(["Dashboard", "All Site Settings"])
|
||||
end
|
||||
|
||||
it "allows further filtering of site settings or users if links do not show results" do
|
||||
|
||||
Reference in New Issue
Block a user