mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
Add tests for groups pages, DRY html into a component
This commit is contained in:
@ -0,0 +1,7 @@
|
|||||||
|
<div class='user-stream'>
|
||||||
|
{{#each posts as |post|}}
|
||||||
|
{{group-post post=post}}
|
||||||
|
{{else}}
|
||||||
|
<div>{{i18n emptyText}}</div>
|
||||||
|
{{/each}}
|
||||||
|
</div>
|
@ -1,7 +1 @@
|
|||||||
<div class='user-stream'>
|
{{group-post-stream posts=controller emptyText="groups.empty.posts"}}
|
||||||
{{#each controller as |post|}}
|
|
||||||
{{group-post post=post}}
|
|
||||||
{{else}}
|
|
||||||
<div>{{i18n "groups.empty.posts"}}</div>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
|
@ -1,8 +1 @@
|
|||||||
<div class='user-stream'>
|
{{group-post-stream posts=controller emptyText="groups.empty.mentions"}}
|
||||||
{{#each controller as |post|}}
|
|
||||||
{{group-post post=post}}
|
|
||||||
{{else}}
|
|
||||||
<div>{{i18n "groups.empty.mentions"}}</div>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
@ -1,7 +1 @@
|
|||||||
<div class='user-stream'>
|
{{group-post-stream posts=controller emptyText="groups.empty.messages"}}
|
||||||
{{#each controller as |post|}}
|
|
||||||
{{group-post post=post}}
|
|
||||||
{{else}}
|
|
||||||
<div>{{i18n "groups.empty.messages"}}</div>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
|
@ -1,7 +1 @@
|
|||||||
<div class='user-stream'>
|
{{group-post-stream posts=controller emptyText="groups.empty.topics"}}
|
||||||
{{#each controller as |post|}}
|
|
||||||
{{group-post post=post}}
|
|
||||||
{{else}}
|
|
||||||
<div>{{i18n "groups.empty.topics"}}</div>
|
|
||||||
{{/each}}
|
|
||||||
</div>
|
|
||||||
|
@ -11,4 +11,19 @@ test("Browsing Groups", () => {
|
|||||||
andThen(() => {
|
andThen(() => {
|
||||||
ok(count('.group-members tr') > 0, "it lists group members");
|
ok(count('.group-members tr') > 0, "it lists group members");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
visit("/groups/discourse/topics");
|
||||||
|
andThen(() => {
|
||||||
|
ok(count('.user-stream .item') > 0, "it lists stream items");
|
||||||
|
});
|
||||||
|
|
||||||
|
visit("/groups/discourse/mentions");
|
||||||
|
andThen(() => {
|
||||||
|
ok(count('.user-stream .item') > 0, "it lists stream items");
|
||||||
|
});
|
||||||
|
|
||||||
|
visit("/groups/discourse/messages");
|
||||||
|
andThen(() => {
|
||||||
|
ok(count('.user-stream .item') > 0, "it lists stream items");
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
File diff suppressed because one or more lines are too long
@ -170,6 +170,18 @@ export default function() {
|
|||||||
slug: request.params.slug } });
|
slug: request.params.slug } });
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.get("/groups/discourse/topics.json", () => {
|
||||||
|
return response(200, fixturesByUrl['/groups/discourse/posts.json']);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.get("/groups/discourse/mentions.json", () => {
|
||||||
|
return response(200, fixturesByUrl['/groups/discourse/posts.json']);
|
||||||
|
});
|
||||||
|
|
||||||
|
this.get("/groups/discourse/messages.json", () => {
|
||||||
|
return response(200, fixturesByUrl['/groups/discourse/posts.json']);
|
||||||
|
});
|
||||||
|
|
||||||
this.get('/t/:topic_id/posts.json', request => {
|
this.get('/t/:topic_id/posts.json', request => {
|
||||||
const postIds = request.queryParams.post_ids;
|
const postIds = request.queryParams.post_ids;
|
||||||
const posts = postIds.map(p => ({id: parseInt(p), post_number: parseInt(p) }));
|
const posts = postIds.map(p => ({id: parseInt(p), post_number: parseInt(p) }));
|
||||||
|
Reference in New Issue
Block a user