From e2a2494dd2ea00a83383618538c85431341d71ec Mon Sep 17 00:00:00 2001 From: Tifenn Guillas <tifenn.guillas@gmail.com> Date: Fri, 24 Sep 2021 11:47:24 +0200 Subject: [PATCH] Add missing test --- .../app/portal/containers/portal-home.component.spec.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/client/src/app/portal/containers/portal-home.component.spec.ts b/client/src/app/portal/containers/portal-home.component.spec.ts index 62309357..18f1e20c 100644 --- a/client/src/app/portal/containers/portal-home.component.spec.ts +++ b/client/src/app/portal/containers/portal-home.component.spec.ts @@ -109,4 +109,11 @@ describe('PortalHomeComponent', () => { expect(spy).toHaveBeenCalledTimes(1); expect(spy).toHaveBeenCalledWith(authActions.openEditProfile()); }); + + it('should unsubscribe to user roles when component is destroyed', () => { + component.userRolesSubscription = of().subscribe(); + const spy = jest.spyOn(component.userRolesSubscription, 'unsubscribe'); + component.ngOnDestroy(); + expect(spy).toHaveBeenCalledTimes(1); + }); }); -- GitLab