discourse/spec/system/page_objects/pages/group_activity_posts.rb
Renato Atilio f5f3742166
FIX: respect creation date when paginating group activity posts (#24993)
* 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.
2024-01-11 13:37:27 -03:00

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