2022-12-22 22:45:29 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2023-06-06 21:26:58 -04:00
|
|
|
describe "Viewing sidebar preferences", type: :system do
|
2023-06-14 19:31:28 -04:00
|
|
|
let(:user_preferences_navigation_menu_page) do
|
|
|
|
PageObjects::Pages::UserPreferencesNavigationMenu.new
|
|
|
|
end
|
2022-12-22 22:45:29 -05:00
|
|
|
|
|
|
|
before { SiteSetting.navigation_menu = "sidebar" }
|
|
|
|
|
|
|
|
context "as an admin" do
|
2023-11-09 17:47:59 -05:00
|
|
|
fab!(:admin)
|
|
|
|
fab!(:user)
|
2022-12-22 22:45:29 -05:00
|
|
|
|
|
|
|
before { sign_in(admin) }
|
2023-01-09 06:18:21 -05:00
|
|
|
|
2023-06-14 19:31:28 -04:00
|
|
|
it "should be able to view navigation menu preferences of another user" do
|
2023-06-22 12:04:13 -04:00
|
|
|
user.user_option.update!(
|
|
|
|
sidebar_link_to_filtered_list: true,
|
|
|
|
sidebar_show_count_of_new_items: true,
|
|
|
|
)
|
2022-12-22 22:45:29 -05:00
|
|
|
|
2023-06-14 19:31:28 -04:00
|
|
|
user_preferences_navigation_menu_page.visit(user)
|
2022-12-22 22:45:29 -05:00
|
|
|
|
2023-06-22 12:04:13 -04: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-22 22:45:29 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|