Skip to content

Commit

Permalink
fix: sql errors
Browse files Browse the repository at this point in the history
  • Loading branch information
whiitex committed May 19, 2024
1 parent 4602a26 commit d034c33
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions api/src/timeslots/timeslots.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1190,27 +1190,40 @@ describe('TimeslotsController', () => {

describe(' GET /timeslots', () => {
beforeEach(async () => {
await mockRecruitmentSessions.forEach(
async (rs) =>
await recruitmentSessionService.createRecruitmentSession(rs),
);
await mockUsers.forEach(async (u) => await usersService.create(u));
await mockTimeSlots.forEach(
async (ts) => await timeSlotsService.createTimeSlot(ts),
);
await mockAvailability.forEach(
async (a) => await availabilityService.createAvailability(a),
);
await mockRecruitmentSessions.forEach(
async (rs) =>
await recruitmentSessionService.createRecruitmentSession(rs),
);
});

it('should return all available timeslots', async () => {
const expected = [
{
id: 71,
start: '2024-05-19T13:00:00.000Z',
end: '2024-05-19T14:00:00.000Z',
},
{
id: 73,
start: '2024-05-19T15:00:00.000Z',
end: '2024-05-19T16:00:00.000Z',
},
];
return await request(app.getHttpServer())
.get('/timeslots')
.set('Authorization', `Bearer ${newMemberToken}`)
.expect(200)
.expect((res) => {
console.log(res.body);
expect(res.body).toBeInstanceOf(Array);
expect(res.body).toEqual(expected);
});
});
});
Expand Down

0 comments on commit d034c33

Please sign in to comment.