mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
UX: Redesign group page to follow user page.
This commit is contained in:
@@ -24,24 +24,31 @@ test("Viewing Group", () => {
|
||||
ok(count('.group-members tr') > 0, "it lists group members");
|
||||
});
|
||||
|
||||
visit("/groups/discourse/posts");
|
||||
click(".nav-pills li a[title='Activity']");
|
||||
|
||||
andThen(() => {
|
||||
ok(count('.user-stream .item') > 0, "it lists stream items");
|
||||
});
|
||||
|
||||
visit("/groups/discourse/topics");
|
||||
click(".group-activity-nav li a[href='/groups/discourse/activity/topics']");
|
||||
|
||||
andThen(() => {
|
||||
ok(count('.user-stream .item') > 0, "it lists stream items");
|
||||
});
|
||||
|
||||
visit("/groups/discourse/mentions");
|
||||
click(".group-activity-nav li a[href='/groups/discourse/activity/mentions']");
|
||||
|
||||
andThen(() => {
|
||||
ok(count('.user-stream .item') > 0, "it lists stream items");
|
||||
});
|
||||
|
||||
visit("/groups/discourse/messages");
|
||||
andThen(() => {
|
||||
ok(find(".nav-stacked li a[title='Messages']").length === 0, 'it should not show messages tab if user is not admin');
|
||||
equal(
|
||||
find(".group-activity li a[href='/groups/discourse/activity/messages']").length,
|
||||
0,
|
||||
'it should not show messages tab if user is not a group user or admin'
|
||||
);
|
||||
|
||||
ok(find(".nav-stacked li a[title='Edit Group']").length === 0, 'it should not show messages tab if user is not admin');
|
||||
ok(find(".nav-stacked li a[title='Logs']").length === 0, 'it should not show Logs tab if user is not admin');
|
||||
ok(count('.user-stream .item') > 0, "it lists stream items");
|
||||
@@ -55,10 +62,19 @@ test("Admin Viewing Group", () => {
|
||||
visit("/groups/discourse");
|
||||
|
||||
andThen(() => {
|
||||
ok(find(".nav-stacked li a[title='Messages']").length === 1, 'it should show messages tab if user is admin');
|
||||
ok(find(".nav-stacked li a[title='Edit Group']").length === 1, 'it should show edit group tab if user is admin');
|
||||
ok(find(".nav-stacked li a[title='Logs']").length === 1, 'it should show Logs tab if user is admin');
|
||||
ok(find(".nav-pills li a[title='Edit Group']").length === 1, 'it should show edit group tab if user is admin');
|
||||
ok(find(".nav-pills li a[title='Logs']").length === 1, 'it should show Logs tab if user is admin');
|
||||
|
||||
equal(find('.group-info-name').text(), 'Awesome Team', 'it should display the group name');
|
||||
});
|
||||
|
||||
click(".nav-pills li a[title='Activity']");
|
||||
|
||||
andThen(() => {
|
||||
equal(
|
||||
find(".group-activity li a[href='/groups/discourse/activity/messages']").length,
|
||||
1,
|
||||
'it should show messages tab if user is admin'
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user