FIX: Missing action to trigger add group members modal for group owners.

https://meta.discourse.org/t/unable-to-add-members-to-a-group-as-group-owner-who-is-not-staff/85346?u=tgxworld
This commit is contained in:
Guo Xiang Tan 2018-04-16 09:09:47 +08:00
parent c74c933996
commit 6cce839f0a
2 changed files with 18 additions and 1 deletions

View File

@ -10,6 +10,7 @@
showBulkAddModal="showBulkAddModal"}}
{{else}}
{{d-button icon="plus"
action="showAddMembersModal"
label="groups.add_members.title"
class="group-members-add"}}
{{/if}}

View File

@ -1,4 +1,4 @@
import { acceptance, logIn } from "helpers/qunit-helpers";
import { acceptance, logIn, replaceCurrentUser } from "helpers/qunit-helpers";
acceptance("Group Members");
@ -22,6 +22,22 @@ QUnit.test("Viewing Members as anon user", assert => {
});
});
QUnit.test("Viewing Members as a group owner", assert => {
logIn();
Discourse.reset();
replaceCurrentUser({ admin: false, staff: false });
visit("/groups/discourse");
click('.group-members-add');
andThen(() => {
assert.equal(
find('#group-add-members-user-selector').length, 1,
'it should display the add members modal'
);
});
});
QUnit.test("Viewing Members as an admin user", assert => {
logIn();
Discourse.reset();