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 62309357aff084efb4cfaa669b16a6af93ad2321..18f1e20ca2e61cc33804cfa2cf6196ae2458bfe6 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); + }); });