Skip to content

Commit

Permalink
debug: test 9
Browse files Browse the repository at this point in the history
  • Loading branch information
whiitex committed May 19, 2024
1 parent 22522fc commit a4a43ad
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 23 deletions.
22 changes: 0 additions & 22 deletions api/src/timeslots/timeslots.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -910,28 +910,6 @@ describe('TimeslotsController', () => {
expect(allAvailabilities).toHaveLength(mockAvailability.length);
});

it('DEBUG: check format of an Availabilities table in db', async () => {
const availability = await availabilityService.findById(1);
expect(availability).toBeDefined();
expect(availability).toHaveProperty('id', 1);
expect(availability).toHaveProperty('state');
expect(availability).toHaveProperty('lastModified');
expect(availability).toHaveProperty('timeSlot');
expect(availability).toHaveProperty('user');
expect(availability).toEqual(mockAvailability[0]);
});

it('DEBUG: check format of a TimeSlots table in db', async () => {
const timeSlot = await timeSlotsService.findById(51);
expect(timeSlot).toBeDefined();
expect(timeSlot).toHaveProperty('id', 51);
expect(timeSlot).toHaveProperty('start');
expect(timeSlot).toHaveProperty('end');
expect(timeSlot).toHaveProperty('recruitmentSession');
expect(timeSlot).toHaveProperty('availabilities');
expect(timeSlot).toEqual(mockTimeSlots[0]);
});

it('DEBUG: check availabilities for timeslot having id 71 & 73', async () => {
const allAvailabilities = await availabilityService.listAvailabilities();
const av71 = allAvailabilities.filter((a) => a.timeSlot.id === 71);
Expand Down
3 changes: 2 additions & 1 deletion api/src/timeslots/timeslots.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export class TimeSlotsService {
);

queryBuilder.getMany();
const allMatches = await this.timeSlotRepository.find({
return await this.timeSlotRepository.find({
relations: [
'availabilities',
'availabilities.user',
Expand All @@ -201,6 +201,7 @@ export class TimeSlotsService {
},
},
});
let allMatches = await queryBuilder.getMany();

let goodTimeSlots: TimeSlot[] = [];
allMatches.forEach((timeSlot) => {
Expand Down

0 comments on commit a4a43ad

Please sign in to comment.