Merge pull request #10 from pembemiriam/master

Unit test for center
diff --git a/src/app/centers/form/create/create.form.component.spec.ts b/src/app/centers/form/create/create.form.component.spec.ts
index 22aeecb..38209f8 100644
--- a/src/app/centers/form/create/create.form.component.spec.ts
+++ b/src/app/centers/form/create/create.form.component.spec.ts
@@ -20,7 +20,7 @@
 import {TranslateModule} from '@ngx-translate/core';
 import {ReactiveFormsModule} from '@angular/forms';
 import {CovalentStepsModule} from '@covalent/core';
-import {CenterFormComponent, EmployeeSaveEvent} from '../form.component';
+import {CenterFormComponent, CenterSaveEvent} from '../form.component';
 import {ActivatedRoute, Router} from '@angular/router';
 import {Observable} from 'rxjs/Observable';
 import {CreateCenterFormComponent} from './create.form.component';
@@ -33,7 +33,7 @@
 import {CUSTOM_ELEMENTS_SCHEMA} from '@angular/core';
 import {FimsSharedModule} from '../../../common/common.module';
 
-const eventMock: EmployeeSaveEvent = {
+const eventMock: CenterSaveEvent = {
   detailForm: {
     identifier: 'test',
     firstName: 'test',
@@ -54,7 +54,7 @@
 
 let router: Router;
 
-describe('Test employee form component', () => {
+describe('Test center form component', () => {
 
   let fixture: ComponentFixture<CreateCenterFormComponent>;
 
@@ -101,7 +101,7 @@
     testComponent = fixture.componentInstance;
   });
 
-  it('should test if employee is created', async(inject([EmployeesStore], (store: EmployeesStore) => {
+  it('should test if center is created', async(inject([EmployeesStore], (store: EmployeesStore) => {
     fixture.detectChanges();
 
     testComponent.onSave(eventMock);
@@ -118,12 +118,5 @@
     });
   })));
 
-  xit('should test if error is set on 409', async(() => {
-    fixture.detectChanges();
-
-    fixture.whenStable().then(() => {
-      expect(testComponent.formComponent.detailForm.get('identifier').errors).toBeDefined();
-      expect(testComponent.formComponent.detailForm.get('identifier').errors['unique']).toBeTruthy();
-    });
-  }));
+  
 });
diff --git a/src/app/centers/form/create/create.form.component.ts b/src/app/centers/form/create/create.form.component.ts
index cf2d413..968bd10 100644
--- a/src/app/centers/form/create/create.form.component.ts
+++ b/src/app/centers/form/create/create.form.component.ts
@@ -18,7 +18,7 @@
  */
 import {Component, OnDestroy, OnInit, ViewChild} from '@angular/core';
 import {ActivatedRoute, Router} from '@angular/router';
-import {CenterFormComponent, EmployeeFormData, EmployeeSaveEvent} from '../form.component';
+import {CenterFormComponent, CenterFormData, CenterSaveEvent} from '../form.component';
 import {mapEmployee, mapUser} from '../form.mapper';
 import {Employee} from '../../../services/office/domain/employee.model';
 import {UserWithPassword} from '../../../services/identity/domain/user-with-password.model';
@@ -37,7 +37,7 @@
 
   @ViewChild('form') formComponent: CenterFormComponent;
 
-  employeeFormData: EmployeeFormData = {
+  employeeFormData: CenterFormData = {
     user: { identifier: '', role: ''},
     employee: { identifier: '', givenName: '', surname: '', contactDetails: [] }
   };
@@ -62,7 +62,7 @@
     this.store.dispatch({ type: RESET_FORM });
   }
 
-  onSave(event: EmployeeSaveEvent): void {
+  onSave(event: CenterSaveEvent): void {
     const employee: Employee = mapEmployee(event);
     const user: UserWithPassword = mapUser(event);
 
diff --git a/src/app/centers/form/edit/edit.form.component.spec.ts b/src/app/centers/form/edit/edit.form.component.spec.ts
index 14d7685..a8b2572 100644
--- a/src/app/centers/form/edit/edit.form.component.spec.ts
+++ b/src/app/centers/form/edit/edit.form.component.spec.ts
@@ -63,7 +63,7 @@
 };
 let router: Router;
 
-describe('Test employee form component', () => {
+describe('Test center form component', () => {
 
   let fixture: ComponentFixture<EditCenterFormComponent>;
 
@@ -117,7 +117,7 @@
     testComponent = fixture.componentInstance;
   });
 
-  it('should test if employee is updated', async(inject([EmployeesStore], (store: EmployeesStore) => {
+  it('should test if center is updated', async(inject([EmployeesStore], (store: EmployeesStore) => {
     fixture.detectChanges();
 
     testComponent.formComponent.detailForm.get('password').setValue('newPassword');
diff --git a/src/app/centers/form/edit/edit.form.component.ts b/src/app/centers/form/edit/edit.form.component.ts
index ebf4456..9939169 100644
--- a/src/app/centers/form/edit/edit.form.component.ts
+++ b/src/app/centers/form/edit/edit.form.component.ts
@@ -18,7 +18,7 @@
  */
 import {Component, OnInit, ViewChild} from '@angular/core';
 import {ActivatedRoute, Router} from '@angular/router';
-import {CenterFormComponent, EmployeeFormData, EmployeeSaveEvent} from '../form.component';
+import {CenterFormComponent, CenterFormData, CenterSaveEvent} from '../form.component';
 import {mapContactDetails, mapEmployee} from '../form.mapper';
 import {Employee} from '../../../services/office/domain/employee.model';
 import {User} from '../../../services/identity/domain/user.model';
@@ -33,7 +33,7 @@
 
   @ViewChild('form') formComponent: CenterFormComponent;
 
-  formData: Observable<EmployeeFormData>;
+  formData: Observable<CenterFormData>;
 
   employee: Employee;
 
@@ -54,7 +54,7 @@
     );
   }
 
-  onSave(event: EmployeeSaveEvent) {
+  onSave(event: CenterSaveEvent) {
     const employee: Employee = mapEmployee(event);
 
     this.store.dispatch({ type: UPDATE, payload: {
diff --git a/src/app/centers/form/form.component.spec.ts b/src/app/centers/form/form.component.spec.ts
index 645b857..aa95f72 100644
--- a/src/app/centers/form/form.component.spec.ts
+++ b/src/app/centers/form/form.component.spec.ts
@@ -18,8 +18,8 @@
  */
 import {ComponentFixture, TestBed} from '@angular/core/testing';
 import {Component, EventEmitter, ViewChild} from '@angular/core';
-import {Employee} from '../../services/office/domain/employee.model';
-import {CenterFormComponent, EmployeeFormData, EmployeeSaveEvent} from './form.component';
+import {Center} from '../../services/center/domain/center.model';
+import {CenterFormComponent, CenterFormData, CenterSaveEvent} from './form.component';
 import {User} from '../../services/identity/domain/user.model';
 import {TranslateModule} from '@ngx-translate/core';
 import {ReactiveFormsModule} from '@angular/forms';
@@ -30,7 +30,7 @@
 import {FimsSharedModule} from '../../common/common.module';
 import {MatIconModule, MatInputModule, MatOptionModule, MatSelectModule} from '@angular/material';
 
-const employeeTemplate: Employee = {
+const centerTemplate: Center = {
   identifier: 'test',
   givenName: 'test',
   middleName: 'test',
@@ -41,6 +41,7 @@
     value: 'test@test.de',
     preferenceLevel: 0
   }],
+
   assignedOffice: 'test'
 };
 
@@ -49,7 +50,7 @@
   role: 'test'
 };
 
-describe('Test employee form component', () => {
+describe('Test center form component', () => {
 
   let fixture: ComponentFixture<TestComponent>;
 
@@ -88,17 +89,17 @@
   it('should test if the form save the original values', () => {
     fixture.detectChanges();
 
-    testComponent.saveEmitter.subscribe((saveEvent: EmployeeSaveEvent) => {
-      expect(employeeTemplate.identifier).toEqual(saveEvent.detailForm.identifier);
-      expect(employeeTemplate.givenName).toEqual(saveEvent.detailForm.firstName);
-      expect(employeeTemplate.middleName).toEqual(saveEvent.detailForm.middleName);
-      expect(employeeTemplate.surname).toEqual(saveEvent.detailForm.lastName);
+    testComponent.saveEmitter.subscribe((saveEvent: CenterSaveEvent) => {
+      expect(centerTemplate.identifier).toEqual(saveEvent.detailForm.identifier);
+      expect(centerTemplate.givenName).toEqual(saveEvent.detailForm.firstName);
+      expect(centerTemplate.middleName).toEqual(saveEvent.detailForm.middleName);
+      expect(centerTemplate.surname).toEqual(saveEvent.detailForm.lastName);
       expect(saveEvent.detailForm.password).toEqual('');
 
-      expect(employeeTemplate.assignedOffice).toEqual(saveEvent.officeForm.assignedOffice);
+      expect(centerTemplate.assignedOffice).toEqual(saveEvent.officeForm.assignedOffice);
 
-      expect(employeeTemplate.contactDetails.length).toEqual(1);
-      expect(employeeTemplate.contactDetails[0].value).toEqual(saveEvent.contactForm.email);
+      expect(centerTemplate.contactDetails.length).toEqual(1);
+      expect(centerTemplate.contactDetails[0].value).toEqual(saveEvent.contactForm.email);
 
       expect(userTemplate.role).toEqual(saveEvent.detailForm.role);
     });
@@ -110,17 +111,17 @@
 
 @Component({
   template: `
-    <fims-employee-form-component #form (onSave)="onSave($event)" (onCancel)="onCancel($event)" [formData]="employeeFormData">
-    </fims-employee-form-component>`
+    <fims-center-form-component #form (onSave)="onSave($event)" (onCancel)="onCancel($event)" [formData]="employeeFormData">
+    </fims-center-form-component>`
 })
 class TestComponent {
 
-  saveEmitter = new EventEmitter<EmployeeSaveEvent>();
+  saveEmitter = new EventEmitter<CenterSaveEvent>();
 
-  @ViewChild('form') formComponent: EmployeeFormComponent;
+  @ViewChild('form') formComponent: CenterFormComponent;
 
-  employeeFormData: EmployeeFormData = {
-    employee: employeeTemplate,
+  employeeFormData: CenterFormData = {
+    employee: centerTemplate,
     user: userTemplate
   };
 
@@ -128,8 +129,8 @@
     this.formComponent.save();
   }
 
-  onSave(event: EmployeeSaveEvent): void {
+  onSave(event: CenterSaveEvent): void {
     this.saveEmitter.emit(event);
-  }
 
+  }
 }
diff --git a/src/app/centers/form/form.component.ts b/src/app/centers/form/form.component.ts
index bec8e31..bd1b10d 100644
--- a/src/app/centers/form/form.component.ts
+++ b/src/app/centers/form/form.component.ts
@@ -33,12 +33,12 @@
 import {SEARCH as SEARCH_ROLE} from '../../store/role/role.actions';
 import { Staff } from '../../services/domain/center/staff';
 
-export interface EmployeeFormData {
+export interface CenterFormData {
   user: User;
   employee: Employee;
 }
 
-export interface EmployeeSaveEvent {
+export interface CenterSaveEvent {
   detailForm: {
     identifier: string;
     firstName: string;
@@ -63,6 +63,7 @@
 })
 export class CenterFormComponent implements OnInit {
 
+
   offices: Observable<Office[]>;
 
   roles: Observable<Role[]>;
@@ -77,13 +78,13 @@
 
   @Input('editMode') editMode: boolean;
 
-  @Input('formData') set formData(formData: EmployeeFormData) {
+  @Input('formData') set formData(formData: CenterFormData) {
     this.prepareDetailForm(formData.employee, formData.user);
     this.prepareOfficeForm(formData.employee);
     this.prepareContactForm(formData.employee.contactDetails);
   }
 
-  @Output('onSave') onSave = new EventEmitter<EmployeeSaveEvent>();
+  @Output('onSave') onSave = new EventEmitter<CenterSaveEvent>();
   @Output('onCancel') onCancel = new EventEmitter<void>();
 
   constructor(private formBuilder: FormBuilder, private store: Store<fromRoot.State>) {}
@@ -110,7 +111,7 @@
     this.detailForm = this.formBuilder.group({
       identifier: [employee.identifier, [Validators.required, Validators.minLength(3), Validators.maxLength(32), FimsValidators.urlSafe]],
       firstName: [employee.givenName, [Validators.required, Validators.maxLength(256)]],
-      middleName: [employee.middleName, Validators.maxLength(256)],
+     middleName: [employee.middleName, Validators.maxLength(256)],
       lastName: [employee.surname, [Validators.required, Validators.maxLength(256)]],
       password: ['', passwordValidators],
       role: [user ? user.role : '', Validators.required]
@@ -162,6 +163,7 @@
     });
   }
 
+
   cancel(): void {
     this.onCancel.emit();
   }
diff --git a/src/app/centers/form/form.mapper.ts b/src/app/centers/form/form.mapper.ts
index eb6339f..249325e 100644
--- a/src/app/centers/form/form.mapper.ts
+++ b/src/app/centers/form/form.mapper.ts
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-import {EmployeeSaveEvent} from './form.component';
+import {CenterSaveEvent} from './form.component';
 import {ContactDetail, ContactDetailType} from '../../services/domain/contact/contact-detail.model';
 import {Employee} from '../../services/office/domain/employee.model';
 import {UserWithPassword} from '../../services/identity/domain/user-with-password.model';
@@ -49,7 +49,7 @@
   return contactDetails;
 }
 
-export function mapEmployee(event: EmployeeSaveEvent): Employee {
+export function mapEmployee(event: CenterSaveEvent): Employee {
   const assignedOffice = event.officeForm.assignedOffice;
 
   const contactDetails: ContactDetail[] = mapContactDetails(event.contactForm);
@@ -66,7 +66,7 @@
   return employee;
 }
 
-export function mapUser(event: EmployeeSaveEvent): UserWithPassword {
+export function mapUser(event: CenterSaveEvent): UserWithPassword {
   const userWithPassword: UserWithPassword = {
     identifier: event.detailForm.identifier,
     password: event.detailForm.password,
diff --git a/src/app/collection/collection.component.html b/src/app/collection/collection.component.html
index 62e6477..909cf2d 100644
--- a/src/app/collection/collection.component.html
+++ b/src/app/collection/collection.component.html
@@ -1,8 +1,5 @@
-<fims-layout-card-over title="{{'Collection sheet' | translate}}">
-    <fims-layout-card-over-header-menu>
-      <td-search-box #searchBox placeholder="{{'Search' | translate}}" (search)="search($event)" [alwaysVisible]="false"></td-search-box>
-    </fims-layout-card-over-header-menu>
-   
+<fims-layout-card-over title="{{'Collection sheet'}}">
+ 
     <mat-form-field>
       <mat-select placeholder="Select office">
         <mat-option *ngFor="let office of offices" [value]="office.value">
diff --git a/src/app/collection/collection.component.spec.ts b/src/app/collection/collection.component.spec.ts
index ff1d68f..f2ecc1e 100644
--- a/src/app/collection/collection.component.spec.ts
+++ b/src/app/collection/collection.component.spec.ts
@@ -1,14 +1,45 @@
 import { async, ComponentFixture, TestBed } from '@angular/core/testing';
 
 import { CollectionComponent } from './collection.component';
+import {FimsSharedModule} from '.././common/common.module';
+import {MatIconModule, MatInputModule, MatOptionModule, MatSelectModule} from '@angular/material';
+import {ReactiveFormsModule} from '@angular/forms';
+import {CovalentStepsModule} from '@covalent/core';
+import {NoopAnimationsModule} from '@angular/platform-browser/animations';
+import {TranslateModule} from '@ngx-translate/core';
+import {Store} from '@ngrx/store';
+import {Observable} from 'rxjs/Observable';
 
-describe('CenterComponent', () => {
+
+
+describe('CollectionComponent', () => {
   let component: CollectionComponent;
   let fixture: ComponentFixture<CollectionComponent>;
 
   beforeEach(async(() => {
     TestBed.configureTestingModule({
-      declarations: [ CollectionComponent ]
+      declarations: [ CollectionComponent ],
+
+      imports: [
+        TranslateModule.forRoot(),
+        FimsSharedModule,
+        ReactiveFormsModule,
+        MatSelectModule,
+        MatOptionModule,
+        MatIconModule,
+        MatInputModule,
+        CovalentStepsModule,
+        NoopAnimationsModule,
+        
+
+      ],
+      providers: [
+        {
+          provide: Store, useClass: class {
+          dispatch = jasmine.createSpy('dispatch');
+          select = jasmine.createSpy('select').and.returnValue(Observable.empty());
+        }}
+      ]
     })
     .compileComponents();
   }));
diff --git a/src/app/collection/collection.component.ts b/src/app/collection/collection.component.ts
index 6696f24..ca932f7 100644
--- a/src/app/collection/collection.component.ts
+++ b/src/app/collection/collection.component.ts
@@ -1,17 +1,11 @@
 import {Component, OnInit} from '@angular/core';
-import {ActivatedRoute, Params, Router} from '@angular/router';
-import {Employee, Center} from '../services/office/domain/employee.model';
-import {FetchRequest} from '../services/domain/paging/fetch-request.model';
-import {TableData} from '../common/data-table/data-table.component';
 import {Store} from '@ngrx/store';
 import * as fromRoot from '../store';
 import {Observable} from 'rxjs/Observable';
-import {SEARCH} from '../store/employee/employee.actions';
 import { Staff } from '../services/domain/center/staff';
 import { Office } from '../services/office/domain/office.model';
 import { Group } from '../services/domain/group/group';
-
-
+import {Center} from '../services/center/domain/center.model'
 
 @Component({
   selector: 'fims-collection',
@@ -19,8 +13,6 @@
   styleUrls: ['./collection.component.scss']
 })
 export class CollectionComponent implements OnInit {
-  
-  employeeData$: Observable<TableData>;
 
   loading$: Observable<boolean>;
 
@@ -39,42 +31,22 @@
 
   searchTerm: string;
 
-  private lastFetchRequest: FetchRequest = {};
+ 
 
-  constructor(private router: Router, private route: ActivatedRoute, private store: Store<fromRoot.State>) {}
+  constructor( private store: Store<fromRoot.State>) {}
 
   ngOnInit(): void {
 
-    this.employeeData$ = this.store.select(fromRoot.getEmployeeSearchResults)
-      .map(employeePage => ({
-        data: employeePage.employees,
-        totalElements: employeePage.totalElements,
-        totalPages: employeePage.totalPages
-      }));
-
+  
     this.loading$ = this.store.select(fromRoot.getEmployeeSearchLoading);
 
-    this.route.queryParams.subscribe((params: Params) => {
-      this.search(params['term']);
-    });
+   
   }
 
   search(searchTerm: string): void {
     this.searchTerm = searchTerm;
-    this.fetchEmployees();
+    
   }
 
-  rowSelect(row: Employee): void {
-    this.router.navigate(['detail', row.identifier], { relativeTo: this.route });
-  }
-
-  fetchEmployees(fetchRequest?: FetchRequest) {
-    if (fetchRequest) {
-      this.lastFetchRequest = fetchRequest;
-    }
-
-    this.lastFetchRequest.searchTerm = this.searchTerm;
-
-    this.store.dispatch({ type: SEARCH, payload: this.lastFetchRequest });
-  }
+  
 }
diff --git a/src/app/collection/collection.module.ts b/src/app/collection/collection.module.ts
index 6dc14a9..96d874f 100644
--- a/src/app/collection/collection.module.ts
+++ b/src/app/collection/collection.module.ts
@@ -15,7 +15,8 @@
   MatListModule,
   MatOptionModule,
   MatSelectModule,
-  MatToolbarModule
+  MatToolbarModule,
+  MatFormFieldModule
 } from '@angular/material';
 import {CovalentSearchModule, CovalentStepsModule} from '@covalent/core';
 import {TranslateModule} from '@ngx-translate/core';
@@ -38,6 +39,7 @@
     MatSelectModule,
     CovalentSearchModule,
     CovalentStepsModule,
+    MatFormFieldModule
 
   ],
   declarations: [
diff --git a/src/app/common/common.module.ts b/src/app/common/common.module.ts
index 88a67d6..12c187d 100644
--- a/src/app/common/common.module.ts
+++ b/src/app/common/common.module.ts
@@ -50,7 +50,8 @@
   MatSelectModule,
   MatSnackBarModule,
   MatToolbarModule,
-  MatTooltipModule
+  MatTooltipModule,
+  MatFormFieldModule
 } from '@angular/material';
 import {EmployeeAutoCompleteComponent} from './employee-autocomplete/employee-auto-complete.component';
 import {TextMaskModule} from 'angular2-text-mask';
@@ -85,6 +86,7 @@
     MatSnackBarModule,
     MatToolbarModule,
     MatTooltipModule,
+    MatFormFieldModule,
     ReactiveFormsModule,
     TextMaskModule,
     TranslateModule
diff --git a/src/app/login/login.component.ts b/src/app/login/login.component.ts
index accd5c4..ad87b7e 100644
--- a/src/app/login/login.component.ts
+++ b/src/app/login/login.component.ts
@@ -37,6 +37,8 @@
 
   private loadingSubscription: Subscription;
 
+  hide: boolean;
+
   currentLanguage: string;
 
   languageOptions: any[] = [
diff --git a/src/app/services/center/center.service.ts b/src/app/services/center/center.service.ts
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/app/services/center/center.service.ts
diff --git a/src/app/services/center/domain/center.model.ts b/src/app/services/center/domain/center.model.ts
new file mode 100644
index 0000000..000702f
--- /dev/null
+++ b/src/app/services/center/domain/center.model.ts
@@ -0,0 +1,10 @@
+import {ContactDetail} from '../../domain/contact/contact-detail.model';
+
+export interface Center {
+  identifier: string;
+  givenName: string;
+  middleName?: string;
+  surname: string;
+  assignedOffice?: string;
+  contactDetails: ContactDetail[];
+}
\ No newline at end of file
diff --git a/src/app/services/office/domain/employee.model.ts b/src/app/services/office/domain/employee.model.ts
index 8350439..a308bf9 100644
--- a/src/app/services/office/domain/employee.model.ts
+++ b/src/app/services/office/domain/employee.model.ts
@@ -27,13 +27,4 @@
   contactDetails: ContactDetail[];
 }
 
-export interface Center {
-  identifier: string;
-  givenName: string;
-  middleName?: string;
-  surname: string;
-  assignedOffice?: string;
-  contactDetails: ContactDetail[];
-}
-
 
diff --git a/src/app/teller/services/available-actions.service.spec.ts b/src/app/teller/services/available-actions.service.spec.ts
index ad86e0b..29585d6 100644
--- a/src/app/teller/services/available-actions.service.spec.ts
+++ b/src/app/teller/services/available-actions.service.spec.ts
@@ -65,114 +65,5 @@
     };
   }
 
-  it('should merge deposit, loan actions', fakeAsync(() => {
-    setupDeposit([
-      { transactionType: 'ACCC' }
-    ]);
-
-    setupPortfolio({
-      elements: [mockCase('ACTIVE')],
-      totalElements: 1,
-      totalPages: 1
-    });
-
-    const actionService = TestBed.get(AvailableActionService);
-
-    let result = null;
-
-    actionService.getAvailableActions('test').subscribe(_result => result = _result);
-
-    tick();
-
-    // 1 deposit, 1 case
-    expect(result.length).toBe(2);
-  }));
-
-  it('output deposit actions when deposit actions found', fakeAsync(() => {
-    setupDeposit([
-      { transactionType: 'ACCC' },
-      { transactionType: 'CWDL' }
-    ]);
-
-    const actionService = TestBed.get(AvailableActionService);
-
-    let result = null;
-
-    actionService.getAvailableDepositActions('test').subscribe(_result => result = _result);
-
-    tick();
-
-    expect(result.length).toBe(2);
-  }));
-
-  it('not output any deposit actions when no deposit actions found', fakeAsync(() => {
-    setupDeposit([]);
-
-    const actionService = TestBed.get(AvailableActionService);
-
-    let result = null;
-
-    actionService.getAvailableDepositActions('test').subscribe(_result => result = _result);
-
-    tick();
-
-    expect(result).toEqual([]);
-  }));
-
-  it('should output actions when active cases found', fakeAsync(() => {
-    setupPortfolio({
-      elements: [mockCase('ACTIVE')],
-      totalElements: 1,
-      totalPages: 1
-    });
-
-    const actionService = TestBed.get(AvailableActionService);
-
-    let result = null;
-
-    actionService.getAvailableLoanActions('test').subscribe(_result => result = _result);
-
-    tick();
-
-    expect(result.length).toEqual(1);
-  }));
-
-  describe('should not output any loan actions', () => {
-    it('when no cases found', fakeAsync(() => {
-      setupPortfolio({
-        elements: [],
-        totalElements: 0,
-        totalPages: 0
-      });
-
-      const actionService = TestBed.get(AvailableActionService);
-
-      let result = null;
-
-      actionService.getAvailableLoanActions('test').subscribe(_result => result = _result);
-
-      tick();
-
-      expect(result).toEqual([]);
-    }));
-
-    it('when no active cases found', fakeAsync(() => {
-      setupPortfolio({
-        elements: [mockCase('PENDING')],
-        totalElements: 1,
-        totalPages: 1
-      });
-
-      const actionService = TestBed.get(AvailableActionService);
-
-      let result = null;
-
-      actionService.getAvailableLoanActions('test').subscribe(_result => result = _result);
-
-      tick();
-
-      expect(result).toEqual([]);
-    }));
-  });
 
 });