Skip to content

Commit

Permalink
fix 4
Browse files Browse the repository at this point in the history
  • Loading branch information
whiitex committed May 19, 2024
1 parent 50533c5 commit 682b5b8
Showing 1 changed file with 13 additions and 23 deletions.
36 changes: 13 additions & 23 deletions api/src/timeslots/timeslots.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1190,31 +1190,21 @@ describe('TimeslotsController', () => {

describe(' GET /timeslots', () => {
beforeEach(async () => {
let promises = [];
mockRecruitmentSessions.forEach((rs) =>
promises.push(recruitmentSessionService.createRecruitmentSession(rs)),
);
for (const rs of mockRecruitmentSessions) {
await recruitmentSessionService.createRecruitmentSession(rs);
}

await Promise.all(promises);
for (const u of mockUsers) {
await usersService.create(u);
}

promises = [];
mockUsers.forEach((u) => promises.push(usersService.create(u)));
for (const ts of mockTimeSlots) {
await timeSlotsService.createTimeSlot(ts);
}

await Promise.all(promises);

promises = [];
mockTimeSlots.forEach((ts) =>
promises.push(timeSlotsService.createTimeSlot(ts)),
);

await Promise.all(promises);

promises = [];
mockAvailability.forEach((a) =>
promises.push(availabilityService.createAvailability(a)),
);

await Promise.all(promises);
for (const a of mockAvailability) {
await availabilityService.createAvailability(a);
}
});

it('should return all available timeslots', async () => {
Expand All @@ -1231,7 +1221,7 @@ describe('TimeslotsController', () => {
},
];
return await request(app.getHttpServer())
.get('/v1/timeslots')
.get('/timeslots')
.set('Authorization', `Bearer ${newMemberToken}`)
.expect(200)
.expect((res) => {
Expand Down

0 comments on commit 682b5b8

Please sign in to comment.