Skip to content

Commit

Permalink
fix: add more fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
DevNono committed Oct 5, 2023
1 parent d2d53ba commit 664740f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
10 changes: 5 additions & 5 deletions tests/admin/emails/send.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ describe('POST /admin/emails', () => {

before(async () => {
admin = await createFakeUser({ type: UserType.orga, permissions: [Permission.admin] });
await createFakeTeam({ members: 4, tournament: 'csgo' });
await createFakeTeam({ members: 4, tournament: 'cs2' });
await createFakeTeam({ members: 2, tournament: 'lol' });
[nonAdminUser] = (await createFakeTeam({ members: 5, tournament: 'csgo', locked: true })).players;
[nonAdminUser] = (await createFakeTeam({ members: 5, tournament: 'cs2', locked: true })).players;
adminToken = generateToken(admin);
});

Expand Down Expand Up @@ -163,7 +163,7 @@ describe('POST /admin/emails', () => {
request(app)
.post(`/admin/emails`)
.send({
tournamentId: 'csgo',
tournamentId: 'cs2',
...validMailBody,
})
.set('Authorization', `Bearer ${adminToken}`)
Expand All @@ -173,7 +173,7 @@ describe('POST /admin/emails', () => {
request(app)
.post(`/admin/emails`)
.send({
tournamentId: 'csgo',
tournamentId: 'cs2',
locked: true,
...validMailBody,
})
Expand All @@ -184,7 +184,7 @@ describe('POST /admin/emails', () => {
request(app)
.post(`/admin/emails`)
.send({
tournamentId: 'csgo',
tournamentId: 'cs2',
locked: false,
...validMailBody,
})
Expand Down
6 changes: 3 additions & 3 deletions tests/discord/syncRoles.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ describe('POST /discord/sync-roles', () => {
locked: true,
paid: true,
members: 5,
tournament: 'csgo',
tournament: 'cs2',
});
// We will test with one missing user (he may have left the server)
for (const user of [...team.players.slice(1), ...team.coaches]) registerMember(user.discordId);
Expand All @@ -27,13 +27,13 @@ describe('POST /discord/sync-roles', () => {
const team2 = await createFakeTeam({
locked: false,
members: 2,
tournament: 'csgo',
tournament: 'cs2',
});
registerMember(team2.players[0].discordId);

await database.tournament.update({
where: {
id: 'csgo',
id: 'cs2',
},
data: {
discordRoleId: registerRole(),
Expand Down
4 changes: 2 additions & 2 deletions tests/teams/createTeam.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,12 @@ describe('POST /teams', () => {

const { body } = await request(app)
.post('/teams')
.send({ ...teamBody, tournamentId: 'csgo' })
.send({ ...teamBody, tournamentId: 'cs2' })
.set('Authorization', `Bearer ${newToken}`)
.expect(201);

expect(body.name).to.be.equal(teamBody.name);
expect(body.tournamentId).to.be.equal('csgo');
expect(body.tournamentId).to.be.equal('cs2');
expect(body.captainId).to.be.equal(newUser.id);
const remoteUser = await userOperations.fetchUser(body.captainId);
expect(remoteUser.type).to.be.equal(teamBody.userType);
Expand Down

0 comments on commit 664740f

Please sign in to comment.