mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 12:33:50 +08:00
f5f3742166
* FIX: respect creation date when paginating group activity posts There are scenarios where the chronological order of posts doesn't match the order of their IDs. For instance, when moving the first post from one topic or PM to another, a new post (with a higher ID) will be created, but it will retain the original creation time. This PR changes the group activity page and endpoint to paginate posts using created_at instead of relying on ID ordering.
23 lines
517 B
Ruby
23 lines
517 B
Ruby
# frozen_string_literal: true
|
|
|
|
module PageObjects
|
|
module Pages
|
|
class GroupActivityPosts < PageObjects::Pages::Base
|
|
def visit(group)
|
|
page.visit("/g/#{group.name}/activity/posts")
|
|
self
|
|
end
|
|
|
|
def has_user_stream_item?(count:)
|
|
has_css?(".user-stream-item", count: count)
|
|
end
|
|
|
|
def scroll_to_last_item
|
|
page.execute_script <<~JS
|
|
document.querySelector('.user-stream-item:last-of-type').scrollIntoView(true);
|
|
JS
|
|
end
|
|
end
|
|
end
|
|
end
|