mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Improvements to posts route (#30968)
This update makes some small improvements to the posts route front-end. Specifically, it adds a title to the page, and it improves the positioning of expand/collapse caret.
This commit is contained in:
22
spec/system/page_objects/pages/posts_page.rb
Normal file
22
spec/system/page_objects/pages/posts_page.rb
Normal file
@@ -0,0 +1,22 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
module PageObjects
|
||||
module Pages
|
||||
class Posts < PageObjects::Pages::Base
|
||||
POSTS_PAGE_SELECTOR = ".posts-page"
|
||||
|
||||
def visit
|
||||
page.visit("/posts")
|
||||
self
|
||||
end
|
||||
|
||||
def has_page_title?
|
||||
page.find("#{POSTS_PAGE_SELECTOR} .posts-page__title")
|
||||
end
|
||||
|
||||
def has_posts?(count)
|
||||
page.has_css?("#{POSTS_PAGE_SELECTOR} .post-list .post-list-item", count: count)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
17
spec/system/posts_page_spec.rb
Normal file
17
spec/system/posts_page_spec.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
describe "Posts page", type: :system do
|
||||
fab!(:post)
|
||||
fab!(:post_2) { Fabricate(:post) }
|
||||
fab!(:post_3) { Fabricate(:post) }
|
||||
fab!(:user)
|
||||
let(:posts_page) { PageObjects::Pages::Posts.new }
|
||||
|
||||
before { sign_in(user) }
|
||||
|
||||
it "renders the posts page with posts" do
|
||||
posts_page.visit
|
||||
expect(posts_page).to have_page_title
|
||||
expect(posts_page).to have_posts(3)
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user