fix(tests): update Challenges block for sunset

This commit is contained in:
SabreCat
2023-07-25 15:39:17 -05:00
parent 714319d67b
commit 26f5ef093f
5 changed files with 62 additions and 273 deletions

View File

@@ -42,26 +42,7 @@ describe('POST /challenges', () => {
});
});
it('returns error when creating a challenge in a public guild and you are not a member of it', async () => {
const user = await generateUser();
const { group } = await createAndPopulateGroup({
groupDetails: {
type: 'guild',
privacy: 'public',
},
});
await expect(user.post('/challenges', {
group: group._id,
prize: 4,
})).to.eventually.be.rejected.and.eql({
code: 401,
error: 'NotAuthorized',
message: t('mustBeGroupMember'),
});
});
it('return error when creating a challenge with summary with greater than MAX_SUMMARY_SIZE_FOR_CHALLENGES characters', async () => {
it('returns error when creating a challenge with summary with greater than MAX_SUMMARY_SIZE_FOR_CHALLENGES characters', async () => {
const user = await generateUser();
const summary = 'A'.repeat(MAX_SUMMARY_SIZE_FOR_CHALLENGES + 1);
const group = createAndPopulateGroup({
@@ -77,7 +58,7 @@ describe('POST /challenges', () => {
});
});
context('Creating a challenge for a valid group', () => {
context('creating a Challenge for a Group Plan', () => {
let groupLeader;
let group;
let groupMember;
@@ -94,6 +75,7 @@ describe('POST /challenges', () => {
challenges: true,
},
},
upgradeToGroupPlan: true,
});
groupLeader = await populatedGroup.groupLeader.sync();