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