From 527c65c6584b742dba51604293534880995b411d Mon Sep 17 00:00:00 2001 From: white Date: Sun, 19 May 2024 21:57:30 +0200 Subject: [PATCH] debug: test 3 --- api/src/mocks/requests.http | 4 ++++ api/src/timeslots/timeslots.e2e-spec.ts | 16 ++++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/api/src/mocks/requests.http b/api/src/mocks/requests.http index 74e9e9e..56bdf35 100644 --- a/api/src/mocks/requests.http +++ b/api/src/mocks/requests.http @@ -1,2 +1,6 @@ GET http://localhost:3000/v1/timeslots/ +Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Imc4aFdBRTB0U00tX3JJVUR0WElNMyJ9.eyJlbWFpbCI6InBhc3F1YWxlLmJpYW5jb0Boa25wb2xpdG8ub3JnIiwiaXNzIjoiaHR0cHM6Ly9kZXYtYzhyb29jZGw3NjNsbDVxZi5ldS5hdXRoMC5jb20vIiwic3ViIjoiZ29vZ2xlLW9hdXRoMnwxMDYyMjgyMTU0MzYxNTk5ODcwNTEiLCJhdWQiOlsiaHR0cDovL2hrcmVjcnVpdG1lbnQub3JnIiwiaHR0cHM6Ly9kZXYtYzhyb29jZGw3NjNsbDVxZi5ldS5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNzE2MTEzNTk3LCJleHAiOjE3MTYxOTk5OTcsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwiLCJhenAiOiJaekNWd2R2eUJOUWZKc3R1ZUJPcVh3TW1jazZCa0d4NiJ9.PyyW67LJIWc9NbMibzvzfxlY0Pe1YTsZVsV2--ckBQ5hfYsCKqCUi6aIjmiliz_uZO5qdPAsZ7FYNOtOI8fGhPt9QfKSqA166D-CZWnpuwE4cM_EjbpCoHRRQ49r2Ycv_ZnzVXrO6zCyEVZYgx-USGiuBnRcKbIPDJCS4Tc9bcmklcUdq4ujAPtSDdmid9jcVN3DM5eLtXAQuYIUho3G3NRVuKlUnoNIsK16yrKtx5kgOHKuUP6dFYExpp2ViB4oZV-v_linCsXZEE5x-7GBMntJAGtenCs-1uihB-OGLYJY_6fPsRG2rgw5Fl8Ax0Ioc8LeXkwlJ2L-MO1ms-r8uQ + +### +GET http://localhost:3000/v1/availabilities/ Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6Imc4aFdBRTB0U00tX3JJVUR0WElNMyJ9.eyJlbWFpbCI6InBhc3F1YWxlLmJpYW5jb0Boa25wb2xpdG8ub3JnIiwiaXNzIjoiaHR0cHM6Ly9kZXYtYzhyb29jZGw3NjNsbDVxZi5ldS5hdXRoMC5jb20vIiwic3ViIjoiZ29vZ2xlLW9hdXRoMnwxMDYyMjgyMTU0MzYxNTk5ODcwNTEiLCJhdWQiOlsiaHR0cDovL2hrcmVjcnVpdG1lbnQub3JnIiwiaHR0cHM6Ly9kZXYtYzhyb29jZGw3NjNsbDVxZi5ldS5hdXRoMC5jb20vdXNlcmluZm8iXSwiaWF0IjoxNzE2MTEzNTk3LCJleHAiOjE3MTYxOTk5OTcsInNjb3BlIjoib3BlbmlkIHByb2ZpbGUgZW1haWwiLCJhenAiOiJaekNWd2R2eUJOUWZKc3R1ZUJPcVh3TW1jazZCa0d4NiJ9.PyyW67LJIWc9NbMibzvzfxlY0Pe1YTsZVsV2--ckBQ5hfYsCKqCUi6aIjmiliz_uZO5qdPAsZ7FYNOtOI8fGhPt9QfKSqA166D-CZWnpuwE4cM_EjbpCoHRRQ49r2Ycv_ZnzVXrO6zCyEVZYgx-USGiuBnRcKbIPDJCS4Tc9bcmklcUdq4ujAPtSDdmid9jcVN3DM5eLtXAQuYIUho3G3NRVuKlUnoNIsK16yrKtx5kgOHKuUP6dFYExpp2ViB4oZV-v_linCsXZEE5x-7GBMntJAGtenCs-1uihB-OGLYJY_6fPsRG2rgw5Fl8Ax0Ioc8LeXkwlJ2L-MO1ms-r8uQ \ No newline at end of file diff --git a/api/src/timeslots/timeslots.e2e-spec.ts b/api/src/timeslots/timeslots.e2e-spec.ts index 4d94600..d223cfc 100644 --- a/api/src/timeslots/timeslots.e2e-spec.ts +++ b/api/src/timeslots/timeslots.e2e-spec.ts @@ -910,10 +910,22 @@ describe('TimeslotsController', () => { expect(allAvailabilities).toHaveLength(mockAvailability.length); }); + it('DEBUG: check format of an abailability', 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 availabilities for timeslot having id 71 & 73', async () => { const allAvailabilities = await availabilityService.listAvailabilities(); - const av71 = allAvailabilities.filter((a) => a.timeSlotId === 71); - const av73 = allAvailabilities.filter((a) => a.timeSlotId === 73); + const av71 = allAvailabilities.filter((a) => a.timeSlot.id === 71); + const av73 = allAvailabilities.filter((a) => a.timeSlot.id === 73); expect(av71).toHaveLength(4); expect(av73).toHaveLength(2); });