2023-12-20 20:37:20 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
describe "Admin Revamp | Sidebar Navigation | Plugin Links", type: :system do
|
|
|
|
fab!(:admin)
|
|
|
|
let(:sidebar) { PageObjects::Components::NavigationMenu::Sidebar.new }
|
|
|
|
|
|
|
|
before do
|
|
|
|
chat_system_bootstrap
|
2024-01-08 18:06:27 -05:00
|
|
|
SiteSetting.admin_sidebar_enabled_groups = Group::AUTO_GROUPS[:admins]
|
2023-12-20 20:37:20 -05:00
|
|
|
sign_in(admin)
|
|
|
|
end
|
|
|
|
|
|
|
|
it "shows links to enabled plugin admin routes" do
|
|
|
|
visit("/admin")
|
|
|
|
expect(sidebar).to have_section_link("Chat", href: "/admin/plugins/chat")
|
|
|
|
end
|
2024-02-20 21:58:31 -05:00
|
|
|
|
|
|
|
it "does not duplicate links to enabled plugin admin routes when showing and hiding sidebar" do
|
|
|
|
visit("/admin")
|
|
|
|
expect(sidebar).to have_section_link("Chat", href: "/admin/plugins/chat", count: 1)
|
|
|
|
find(".header-sidebar-toggle").click
|
|
|
|
find(".header-sidebar-toggle").click
|
|
|
|
expect(sidebar).to have_section_link("Chat", href: "/admin/plugins/chat", count: 1)
|
|
|
|
end
|
2023-12-20 20:37:20 -05:00
|
|
|
end
|