From 30d4c6ab5a0f238cbb43ae190dfa8d4a8ccea101 Mon Sep 17 00:00:00 2001 From: Giuseppe Digilio Date: Fri, 4 Dec 2020 09:22:31 +0100 Subject: [PATCH] fixed tests --- .../create/resource-policy-create.component.spec.ts | 12 ++++++++---- .../edit/resource-policy-edit.component.spec.ts | 12 ++++++++---- 2 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts b/src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts index 1c41280bab..d7453fcf0e 100644 --- a/src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts +++ b/src/app/shared/resource-policies/create/resource-policy-create.component.spec.ts @@ -152,29 +152,33 @@ describe('ResourcePolicyCreateComponent test suite', () => { fixture.destroy(); }); - it('should init component properly', () => { + it('should init component properly', (done) => { fixture.detectChanges(); expect(compAsAny.targetResourceUUID).toBe('itemUUID'); expect(compAsAny.targetResourceName).toBe('test item'); + done(); }); - it('should redirect to authorizations page', () => { + it('should redirect to authorizations page', (done) => { comp.redirectToAuthorizationsPage(); expect(compAsAny.router.navigate).toHaveBeenCalled(); + done(); }); - it('should return true when is Processing', () => { + it('should return true when is Processing', (done) => { compAsAny.processing$.next(true); expect(comp.isProcessing()).toBeObservable(cold('a', { a: true })); + done(); }); - it('should return false when is not Processing', () => { + it('should return false when is not Processing', (done) => { compAsAny.processing$.next(false); expect(comp.isProcessing()).toBeObservable(cold('a', { a: false })); + done(); }); describe('when target type is group', () => { diff --git a/src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts b/src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts index b124da0219..366f705fd6 100644 --- a/src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts +++ b/src/app/shared/resource-policies/edit/resource-policy-edit.component.spec.ts @@ -137,28 +137,32 @@ describe('ResourcePolicyEditComponent test suite', () => { fixture.destroy(); }); - it('should init component properly', () => { + it('should init component properly', (done) => { fixture.detectChanges(); expect(compAsAny.resourcePolicy).toEqual(resourcePolicy); + done(); }); - it('should redirect to authorizations page', () => { + it('should redirect to authorizations page', (done) => { comp.redirectToAuthorizationsPage(); expect(compAsAny.router.navigate).toHaveBeenCalled(); + done(); }); - it('should return true when is Processing', () => { + it('should return true when is Processing', (done) => { compAsAny.processing$.next(true); expect(comp.isProcessing()).toBeObservable(cold('a', { a: true })); + done(); }); - it('should return false when is not Processing', () => { + it('should return false when is not Processing', (done) => { compAsAny.processing$.next(false); expect(comp.isProcessing()).toBeObservable(cold('a', { a: false })); + done(); }); describe('', () => {