diff --git a/src/app/services/contact.service.spec.ts b/src/app/services/contact.service.spec.ts index f452d52..40437aa 100644 --- a/src/app/services/contact.service.spec.ts +++ b/src/app/services/contact.service.spec.ts @@ -43,6 +43,17 @@ describe('ContactService', () => { httpTestingController.verify(); }); + it('should GET contacts from the contacts ep with the given ID', () => { + const ID_MOCK = 1; + const url = `${endpointURL}/${ID_MOCK}`; + service.findById(String(ID_MOCK)).subscribe(); + const req = httpTestingController.expectOne(url); + expect(req.request.method).toEqual('GET'); + RES_MOCK.data = new ContactDTO(1, 'mock', 'mock', 'mock'); + req.flush(RES_MOCK); + httpTestingController.verify(); + }); + it('should POST contact to the contacts ep', () => { const CONTACT_MOCK = new ContactDTO(undefined, 'mock'); service.save(CONTACT_MOCK).subscribe();