fix(tests): chat related

This commit is contained in:
SabreCat
2023-08-02 18:07:19 -05:00
parent 1df3f9d9f3
commit 8c88f56d08
5 changed files with 47 additions and 334 deletions

View File

@@ -129,6 +129,8 @@ api.postChat = {
if (validationErrors) throw validationErrors;
const group = await Group.getGroup({ user, groupId });
if (!group) throw new NotFound(res.t('groupNotFound'));
const { purchased } = group;
const isUpgraded = purchased && purchased.plan && purchased.plan.customerId
&& (!purchased.plan.dateTerminated || moment().isBefore(purchased.plan.dateTerminated));
@@ -175,8 +177,6 @@ api.postChat = {
throw new BadRequest(res.t('bannedSlurUsed'));
}
if (!group) throw new NotFound(res.t('groupNotFound'));
if (group.privacy === 'public' && user.flags.chatRevoked) {
throw new NotAuthorized(res.t('chatPrivilegesRevoked'));
}