DEV: uses select-kit component for interface spec (#21790)
This commit is contained in:
parent
ac0f5ca1b2
commit
9321299caa
|
@ -39,7 +39,7 @@ module PageObjects
|
|||
end
|
||||
|
||||
def expand
|
||||
collapsed_component.find(":not(.is-expanded) .select-kit-header").click
|
||||
collapsed_component.find(":not(.is-expanded) .select-kit-header", visible: :all).click
|
||||
expanded_component
|
||||
end
|
||||
|
||||
|
|
|
@ -9,32 +9,26 @@ describe "User preferences for Interface", type: :system, js: true do
|
|||
|
||||
describe "Bookmarks" do
|
||||
it "changes the bookmark after notification preference" do
|
||||
skip(<<~TEXT) if ENV["CI"]
|
||||
This is currently failing on CI with the following:
|
||||
user_preferences_page.visit(user)
|
||||
click_link(I18n.t("js.user.preferences_nav.interface"))
|
||||
|
||||
```
|
||||
Failure/Error: expect(page).to have_content(I18n.t("js.saved"))
|
||||
expected `#<Capybara::Session>.has_content?("Saved!")` to be truthy, got false
|
||||
```
|
||||
TEXT
|
||||
|
||||
user_preferences_page.visit(user).click_interface_tab
|
||||
dropdown = PageObjects::Components::SelectKit.new("#bookmark-after-notification-mode")
|
||||
|
||||
# preselects the default user_option.bookmark_auto_delete_preference value of 3 (clear_reminder)
|
||||
expect(user_preferences_interface_page).to have_bookmark_after_notification_mode(
|
||||
Bookmark.auto_delete_preferences[:clear_reminder],
|
||||
)
|
||||
expect(dropdown).to have_selected_value(Bookmark.auto_delete_preferences[:clear_reminder])
|
||||
|
||||
user_preferences_interface_page.select_bookmark_after_notification_mode(
|
||||
Bookmark.auto_delete_preferences[:when_reminder_sent],
|
||||
).save_changes
|
||||
dropdown.select_row_by_value(Bookmark.auto_delete_preferences[:when_reminder_sent])
|
||||
click_button(I18n.t("js.save"))
|
||||
|
||||
# the preference page reloads after saving, so we need to poll the db
|
||||
try_until_success(timeout: 20) do
|
||||
expect(
|
||||
UserOption.exists?(
|
||||
user_id: user.id,
|
||||
bookmark_auto_delete_preference: Bookmark.auto_delete_preferences[:when_reminder_sent],
|
||||
),
|
||||
).to eq(true)
|
||||
).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue