File tree Expand file tree Collapse file tree 5 files changed +56
-5
lines changed
javascripts/discourse/app/templates
stylesheets/common/components Expand file tree Collapse file tree 5 files changed +56
-5
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ import { action } from "@ember/object";
33import RouteTemplate from " ember-route-template" ;
44import PostList from " discourse/components/post-list" ;
55import Posts from " discourse/models/posts" ;
6+ import { i18n } from " discourse-i18n" ;
67
78export default RouteTemplate (
89 class extends Component {
@@ -15,11 +16,14 @@ export default RouteTemplate(
1516 }
1617
1718 <template >
18- <PostList
19- @ posts ={{@ model }}
20- @ fetchMorePosts ={{this .loadMorePosts }}
21- @ titlePath =" topic_html_title"
22- />
19+ <section class =" posts-page" >
20+ <h2 class =" posts-page__title" >{{i18n " post_list.title" }} </h2 >
21+ <PostList
22+ @ posts ={{@ model }}
23+ @ fetchMorePosts ={{this .loadMorePosts }}
24+ @ titlePath =" topic_html_title"
25+ />
26+ </section >
2327 </template >
2428 }
2529);
Original file line number Diff line number Diff line change 3434 }
3535 }
3636
37+ .expand-item ,
38+ .collapse-item {
39+ padding : 0 ;
40+ margin-right : 0.75rem ;
41+ margin-top : 0.15rem ;
42+ }
43+
3744 .stream-topic-title {
3845 overflow-wrap : anywhere;
3946 }
Original file line number Diff line number Diff line change @@ -3763,6 +3763,7 @@ en:
37633763 deleted_by_author_simple : " (topic deleted by author)"
37643764
37653765 post_list :
3766+ title : " Latest posts"
37663767 empty : " There are no posts"
37673768 aria_post_number : " %{title} - post #%{postNumber}"
37683769
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ module PageObjects
4+ module Pages
5+ class Posts < PageObjects ::Pages ::Base
6+ POSTS_PAGE_SELECTOR = ".posts-page"
7+
8+ def visit
9+ page . visit ( "/posts" )
10+ self
11+ end
12+
13+ def has_page_title?
14+ page . find ( "#{ POSTS_PAGE_SELECTOR } .posts-page__title" )
15+ end
16+
17+ def has_posts? ( count )
18+ page . has_css? ( "#{ POSTS_PAGE_SELECTOR } .post-list .post-list-item" , count : count )
19+ end
20+ end
21+ end
22+ end
Original file line number Diff line number Diff line change 1+ # frozen_string_literal: true
2+
3+ describe "Posts page" , type : :system do
4+ fab! ( :post )
5+ fab! ( :post_2 ) { Fabricate ( :post ) }
6+ fab! ( :post_3 ) { Fabricate ( :post ) }
7+ fab! ( :user )
8+ let ( :posts_page ) { PageObjects ::Pages ::Posts . new }
9+
10+ before { sign_in ( user ) }
11+
12+ it "renders the posts page with posts" do
13+ posts_page . visit
14+ expect ( posts_page ) . to have_page_title
15+ expect ( posts_page ) . to have_posts ( 3 )
16+ end
17+ end
You can’t perform that action at this time.
0 commit comments