diff --git a/app/assets/javascripts/discourse/templates/group-index.hbs b/app/assets/javascripts/discourse/templates/group-index.hbs index c0cf37140c7..ee9f4c8659f 100644 --- a/app/assets/javascripts/discourse/templates/group-index.hbs +++ b/app/assets/javascripts/discourse/templates/group-index.hbs @@ -10,6 +10,7 @@ showBulkAddModal="showBulkAddModal"}} {{else}} {{d-button icon="plus" + action="showAddMembersModal" label="groups.add_members.title" class="group-members-add"}} {{/if}} diff --git a/test/javascripts/acceptance/group-index-test.js.es6 b/test/javascripts/acceptance/group-index-test.js.es6 index caa0a3b8d9d..dbb768639c2 100644 --- a/test/javascripts/acceptance/group-index-test.js.es6 +++ b/test/javascripts/acceptance/group-index-test.js.es6 @@ -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();