UX: Allow group owners to manage members from group members page.

This commit is contained in:
Guo Xiang Tan
2018-03-21 18:16:08 +08:00
parent a23509cbf3
commit be866dbe6e
11 changed files with 99 additions and 9 deletions

View File

@@ -0,0 +1,31 @@
import { acceptance, logIn } from "helpers/qunit-helpers";
acceptance("Group Members");
QUnit.test("Viewing Members as anon user", assert => {
visit("/groups/discourse");
andThen(() => {
assert.ok(count('.avatar-flair .fa-adjust') === 1, "it displays the group's avatar flair");
assert.ok(count('.group-members tr') > 0, "it lists group members");
assert.ok(
count('.group-member-dropdown') === 0,
'it does not allow anon user to manage group members'
);
});
});
QUnit.test("Viewing Members as an admin user", assert => {
logIn();
Discourse.reset();
visit("/groups/discourse");
andThen(() => {
assert.ok(
count('.group-member-dropdown') > 0,
'it allows admin user to manage group members'
);
});
});

View File

@@ -69,10 +69,6 @@ QUnit.test("Anonymous Viewing Group", assert => {
visit("/groups/discourse");
andThen(() => {
assert.ok(count('.avatar-flair .fa-adjust') === 1, "it displays the group's avatar flair");
assert.ok(count('.group-members tr') > 0, "it lists group members");
assert.ok(count('.group-message-button') === 0, 'it does not show group message button');
assert.equal(
count(".nav-pills li a[title='Messages']"),
0,