Node.js based forum software built for the modern web
test: add test for #12446
Barış Soner Uşaklıbf4e257c8398
diff --git a/test/groups.js b/test/groups.jsindex 3fc70f009a..7b5ae4d73c 100644--- a/test/groups.js+++ b/test/groups.js@@ -914,6 +914,19 @@ describe('Groups', () => {assert(!isInvited);});+ it('should fail to rescind last owner', async () => {+ const uid = await User.create({ username: 'lastgroupowner' });+ await Groups.create({+ name: 'last owner',+ description: 'Foobar!',+ ownerUid: uid,+ });+ await assert.rejects(+ apiGroups.rescind({ uid: adminUid }, { slug: 'last-owner', uid: uid }),+ { message: '[[error:group-needs-owner]]' },+ );+ });+it('should error if user is not invited', async () => {await assert.rejects(apiGroups.acceptInvite({ uid: adminUid }, { slug: 'privatecanjoin', uid: adminUid }),