diff --git a/app/assets/javascripts/discourse/app/templates/group.hbs b/app/assets/javascripts/discourse/app/templates/group.hbs index da39f6abb57..b988499c80c 100644 --- a/app/assets/javascripts/discourse/app/templates/group.hbs +++ b/app/assets/javascripts/discourse/app/templates/group.hbs @@ -41,7 +41,7 @@ {{/if}} - {{#if this.model.automatic}} + {{#if (and this.currentUser.admin this.model.automatic)}} <:trigger> {{d-icon "gear"}} diff --git a/app/assets/javascripts/discourse/tests/acceptance/group-manage-membership-test.js b/app/assets/javascripts/discourse/tests/acceptance/group-manage-membership-test.js index f6c9abb88fe..4cffab3f43b 100644 --- a/app/assets/javascripts/discourse/tests/acceptance/group-manage-membership-test.js +++ b/app/assets/javascripts/discourse/tests/acceptance/group-manage-membership-test.js @@ -24,6 +24,24 @@ acceptance("Managing Group Membership", function (needs) { ); }); + test("As an admin on an automatic group", async function (assert) { + await visit("/g/moderators"); + + assert + .dom(".admin-group-automatic-tooltip") + .exists("displays automatic tooltip"); + }); + + test("As a non-admin user on an automatic group", async function (assert) { + updateCurrentUser({ admin: false }); + + await visit("/g/moderators"); + + assert + .dom(".admin-group-automatic-tooltip") + .doesNotExist("does not display automatic tooltip"); + }); + test("As an admin", async function (assert) { updateCurrentUser({ can_create_group: true });