mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Refactor user summary page to use more components
This commit is contained in:
@@ -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');
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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' }
|
||||
],
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user