FIX: Bookmark clock icon not showing (#26572)

When choosing the "Custom..." option in the new bookmark
menu and then choosing a date + time in the modal for the
reminder, the bookmark icon on the post was not updating to
show the one with the clock to indicate the reminder.

This was just a data syncing issue between BookmarkFormData
and what the modal sets. Ideally all this would be refactored
because the data flow is messy...but hard to find time for
that right now.

Followup 67a8080e338aa62afbd02efc98178b4a67751775
This commit is contained in:
Martin Brennan
2024-04-09 16:14:59 +10:00
committed by GitHub
parent e2ced85757
commit d7f7915558
3 changed files with 12 additions and 9 deletions

View File

@ -68,12 +68,12 @@ module PageObjects
end
end
def has_post_bookmarked?(post)
is_post_bookmarked(post, bookmarked: true)
def has_post_bookmarked?(post, with_reminder: false)
is_post_bookmarked(post, bookmarked: true, with_reminder: with_reminder)
end
def has_no_post_bookmarked?(post)
is_post_bookmarked(post, bookmarked: false)
def has_no_post_bookmarked?(post, with_reminder: false)
is_post_bookmarked(post, bookmarked: false, with_reminder: with_reminder)
end
def expand_post_actions(post)
@ -238,9 +238,10 @@ module PageObjects
"#topic-footer-button-#{button}"
end
def is_post_bookmarked(post, bookmarked:)
def is_post_bookmarked(post, bookmarked:, with_reminder: false)
within post_by_number(post) do
page.public_send(bookmarked ? :has_css? : :has_no_css?, ".bookmark.bookmarked")
css_class = ".bookmark.bookmarked#{with_reminder ? ".with-reminder" : ""}"
page.public_send(bookmarked ? :has_css? : :has_no_css?, css_class)
end
end
end