2022-12-15 16:50:31 -06:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
describe "User preferences for Interface", type: :system, js: true do
|
|
|
|
fab!(:user) { Fabricate(:user) }
|
|
|
|
let(:user_preferences_page) { PageObjects::Pages::UserPreferences.new }
|
2023-05-28 22:56:21 -05:00
|
|
|
let(:user_preferences_interface_page) { PageObjects::Pages::UserPreferencesInterface.new }
|
2022-12-15 16:50:31 -06:00
|
|
|
|
|
|
|
before { sign_in(user) }
|
|
|
|
|
|
|
|
describe "Bookmarks" do
|
|
|
|
it "changes the bookmark after notification preference" do
|
2023-05-28 22:56:21 -05:00
|
|
|
user_preferences_page.visit(user).click_interface_tab
|
2022-12-15 16:50:31 -06:00
|
|
|
|
|
|
|
# preselects the default user_option.bookmark_auto_delete_preference value of 3 (clear_reminder)
|
2023-05-28 22:56:21 -05:00
|
|
|
expect(user_preferences_interface_page).to have_bookmark_after_notification_mode(
|
|
|
|
Bookmark.auto_delete_preferences[:clear_reminder],
|
2022-12-15 16:50:31 -06:00
|
|
|
)
|
|
|
|
|
2023-05-28 22:56:21 -05:00
|
|
|
user_preferences_interface_page.select_bookmark_after_notification_mode(
|
|
|
|
Bookmark.auto_delete_preferences[:when_reminder_sent],
|
|
|
|
).save_changes
|
2022-12-15 16:50:31 -06:00
|
|
|
|
2023-05-28 22:56:21 -05:00
|
|
|
expect(
|
|
|
|
UserOption.exists?(
|
|
|
|
user_id: user.id,
|
|
|
|
bookmark_auto_delete_preference: Bookmark.auto_delete_preferences[:when_reminder_sent],
|
|
|
|
),
|
|
|
|
).to eq(true)
|
2022-12-15 16:50:31 -06:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|