Refactor user summary page to use more components

This commit is contained in:
Robin Ward
2017-10-13 15:20:42 -04:00
parent f73a3cc0d4
commit 5572d1d5f7
17 changed files with 172 additions and 157 deletions

View File

@@ -30,4 +30,17 @@ QUnit.test("Root URL - Viewing Self", assert => {
assert.equal(currentPath(), 'user.userActivity.index', "it defaults to activity");
assert.ok(exists('.container.viewing-self'), "has the viewing-self class");
});
});
});
QUnit.test("Viewing Summary", assert => {
visit("/u/eviltrout/summary");
andThen(() => {
assert.ok(exists('.replies-section li a'), 'replies');
assert.ok(exists('.topics-section li a'), 'topics');
assert.ok(exists('.links-section li a'), 'links');
assert.ok(exists('.replied-section .user-info'), 'liked by');
assert.ok(exists('.liked-by-section .user-info'), 'liked by');
assert.ok(exists('.liked-section .user-info'), 'liked');
assert.ok(exists('.badges-section .badge-card'), 'badges');
});
});

View File

@@ -81,12 +81,20 @@ export default function() {
this.get('/u/eviltrout/summary.json', () => {
return response({
user_summary: {
topics: [],
topic_ids: [],
replies: [],
links: []
topic_ids: [1234],
replies: [{ topic_id: 1234 }],
links: [{ topic_id: 1234, url: 'https://eviltrout.com' }],
most_replied_to_users: [ { id: 333 } ],
most_liked_by_users: [ { id: 333 } ],
most_liked_users: [ { id: 333 } ],
badges: [ { badge_id: 444 } ]
},
topics: [],
badges: [
{ id: 444, count: 1 }
],
topics: [
{ id: 1234, title: 'cool title', url: '/t/1234/cool-title' }
],
});
});