Add tests for groups pages, DRY html into a component

This commit is contained in:
Robin Ward
2016-04-11 13:16:37 -04:00
parent a359a973e2
commit f6c460c207
8 changed files with 1124 additions and 33 deletions

View File

@@ -11,4 +11,19 @@ test("Browsing Groups", () => {
andThen(() => {
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

View File

@@ -170,6 +170,18 @@ export default function() {
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 => {
const postIds = request.queryParams.post_ids;
const posts = postIds.map(p => ({id: parseInt(p), post_number: parseInt(p) }));