mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
test: add test for #12446
This commit is contained in:
@@ -914,6 +914,19 @@ describe('Groups', () => {
|
|||||||
assert(!isInvited);
|
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 () => {
|
it('should error if user is not invited', async () => {
|
||||||
await assert.rejects(
|
await assert.rejects(
|
||||||
apiGroups.acceptInvite({ uid: adminUid }, { slug: 'privatecanjoin', uid: adminUid }),
|
apiGroups.acceptInvite({ uid: adminUid }, { slug: 'privatecanjoin', uid: adminUid }),
|
||||||
|
|||||||
Reference in New Issue
Block a user