2022-12-23 11:45:29 +08:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-06-07 09:26:58 +08:00
|
|
|
describe "Viewing sidebar preferences", type: :system do
|
2023-06-15 07:31:28 +08:00
|
|
|
let(:user_preferences_navigation_menu_page) do
|
|
|
|
PageObjects::Pages::UserPreferencesNavigationMenu.new
|
|
|
|
end
|
2022-12-23 11:45:29 +08:00
|
|
|
|
|
|
|
before { SiteSetting.navigation_menu = "sidebar" }
|
|
|
|
|
|
|
|
context "as an admin" do
|
2023-11-10 06:47:59 +08:00
|
|
|
fab!(:admin)
|
|
|
|
fab!(:user)
|
2022-12-23 11:45:29 +08:00
|
|
|
|
|
|
|
before { sign_in(admin) }
|
2023-01-09 19:18:21 +08:00
|
|
|
|
2023-06-15 07:31:28 +08:00
|
|
|
it "should be able to view navigation menu preferences of another user" do
|
2023-06-23 00:04:13 +08:00
|
|
|
user.user_option.update!(
|
|
|
|
sidebar_link_to_filtered_list: true,
|
|
|
|
sidebar_show_count_of_new_items: true,
|
|
|
|
)
|
2022-12-23 11:45:29 +08:00
|
|
|
|
2023-06-15 07:31:28 +08:00
|
|
|
user_preferences_navigation_menu_page.visit(user)
|
2022-12-23 11:45:29 +08:00
|
|
|
|
2023-06-23 00:04:13 +08:00
|
|
|
expect(user_preferences_navigation_menu_page).to have_navigation_menu_preference_checked(
|
|
|
|
"pref-show-count-new-items",
|
|
|
|
)
|
|
|
|
expect(user_preferences_navigation_menu_page).to have_navigation_menu_preference_checked(
|
|
|
|
"pref-link-to-filtered-list",
|
|
|
|
)
|
2022-12-23 11:45:29 +08:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|