FIX: relative picker was being reset on change (#26766)

A change in relative picker was causing a serie of events which ultimately would cause the whole list of time options to be reset and re-rendered which would cause a new instance of the picker to be created, causing a reset.

The fix is using id in the each loop to help ember identify that it doesn’t have to re-render a specific component.
This commit is contained in:
Joffrey JAFFEUX
2024-04-26 10:59:51 +02:00
committed by GitHub
parent dad6912566
commit a7f596da7a
3 changed files with 24 additions and 1 deletions

View File

@ -116,6 +116,19 @@ describe "Bookmarking posts and topics", type: :system do
expect(bookmark.reload.name).to eq("something important")
end
end
it "allows to set a relative time" do
bookmark = Fabricate(:bookmark, bookmarkable: topic, user: current_user)
topic_page.visit_topic(topic)
topic_page.click_topic_bookmark_button
bookmark_menu.click_menu_option("edit")
bookmark_modal.select_relative_time_duration(10)
bookmark_modal.select_relative_time_interval("days")
expect(bookmark_modal.custom_time_picker.value).to eq(
bookmark.reminder_at_in_zone(timezone).strftime("%H:%M"),
)
end
end
describe "editing existing bookmarks" do