Skip to content

Commit

Permalink
test: add test for #12446
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Mar 26, 2024
1 parent ed41e41 commit bf4e257
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/groups.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }),
Expand Down

0 comments on commit bf4e257

Please sign in to comment.