mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 21:27:58 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user