diff --git a/src/app/services/auth.service.spec.ts b/src/app/services/auth.service.spec.ts index f5736b2e..29599618 100644 --- a/src/app/services/auth.service.spec.ts +++ b/src/app/services/auth.service.spec.ts @@ -118,6 +118,18 @@ describe('AuthService', () => { req.flush(userResponse); }); + it('should refresh token', () => { + const dummyResponse = { access_token: 'dummyToken' }; + + service.refreshToken().subscribe(res => { + expect(res).toEqual(dummyResponse); + }); + + const req = httpMock.expectOne(`${service.usersAPIURL}/auth/refresh`); + expect(req.request.method).toBe('POST'); + req.flush(dummyResponse); + }); + it('should logout', () => { localStorage.setItem('token', 'testtoken'); service.logout();