@@ -164,14 +164,15 @@ describe('ProcessOverviewComponent', () => {
164164 } ) . compileComponents ( ) ;
165165 } ) ) ;
166166
167+ beforeEach ( ( ) => {
168+ fixture = TestBed . createComponent ( ProcessOverviewComponent ) ;
169+ component = fixture . componentInstance ;
170+ } ) ;
171+
167172 describe ( 'if the current user is an admin' , ( ) => {
168173
169174 beforeEach ( ( ) => {
170-
171175 authorizationService . isAuthorized . and . callFake ( ( ) => of ( true ) ) ;
172-
173- fixture = TestBed . createComponent ( ProcessOverviewComponent ) ;
174- component = fixture . componentInstance ;
175176 fixture . detectChanges ( ) ;
176177 } ) ;
177178
@@ -241,11 +242,7 @@ describe('ProcessOverviewComponent', () => {
241242 describe ( 'if the current user is not an admin' , ( ) => {
242243
243244 beforeEach ( ( ) => {
244-
245245 authorizationService . isAuthorized . and . callFake ( ( ) => of ( false ) ) ;
246-
247- fixture = TestBed . createComponent ( ProcessOverviewComponent ) ;
248- component = fixture . componentInstance ;
249246 fixture . detectChanges ( ) ;
250247 } ) ;
251248
@@ -330,11 +327,7 @@ describe('ProcessOverviewComponent', () => {
330327
331328 describe ( 'overview buttons' , ( ) => {
332329 beforeEach ( ( ) => {
333-
334330 authorizationService . isAuthorized . and . callFake ( ( ) => of ( false ) ) ;
335-
336- fixture = TestBed . createComponent ( ProcessOverviewComponent ) ;
337- component = fixture . componentInstance ;
338331 fixture . detectChanges ( ) ;
339332 } ) ;
340333
@@ -372,11 +365,7 @@ describe('ProcessOverviewComponent', () => {
372365
373366 describe ( 'openDeleteModal' , ( ) => {
374367 beforeEach ( ( ) => {
375-
376368 authorizationService . isAuthorized . and . callFake ( ( ) => of ( false ) ) ;
377-
378- fixture = TestBed . createComponent ( ProcessOverviewComponent ) ;
379- component = fixture . componentInstance ;
380369 fixture . detectChanges ( ) ;
381370 } ) ;
382371
@@ -388,11 +377,7 @@ describe('ProcessOverviewComponent', () => {
388377
389378 describe ( 'deleteSelected' , ( ) => {
390379 beforeEach ( ( ) => {
391-
392380 authorizationService . isAuthorized . and . callFake ( ( ) => of ( false ) ) ;
393-
394- fixture = TestBed . createComponent ( ProcessOverviewComponent ) ;
395- component = fixture . componentInstance ;
396381 fixture . detectChanges ( ) ;
397382 } ) ;
398383
@@ -409,6 +394,11 @@ describe('ProcessOverviewComponent', () => {
409394 } ) ;
410395
411396 describe ( 'getEPersonName function' , ( ) => {
397+ beforeEach ( ( ) => {
398+ authorizationService . isAuthorized . and . callFake ( ( ) => of ( false ) ) ;
399+ fixture . detectChanges ( ) ;
400+ } ) ;
401+
412402 it ( 'should return unknown user when id is null' , ( done : DoneFn ) => {
413403 const id = null ;
414404 const expectedTranslation = 'process.overview.unknown.user' ;
0 commit comments