Skip to content

Commit

Permalink
web-ui: Fix address-details.component.spec
Browse files Browse the repository at this point in the history
  • Loading branch information
JonSalazar committed Jan 18, 2019
1 parent 4f20fb4 commit d5e1a6c
Showing 1 changed file with 30 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,14 +1,43 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { AddressDetailsComponent } from './address-details.component';
import { ExplorerCurrencyPipe } from '../../pipes/explorer-currency.pipe';
import { ExplorerDatetimePipe } from '../../pipes/explorer-datetime.pipe';

import { RouterTestingModule } from '@angular/router/testing';
import { TranslateModule } from '@ngx-translate/core';

import { AddressesService } from '../../services/addresses.service';
import { ErrorService } from '../../services/error.service';
import { Observable } from 'rxjs';

import { NO_ERRORS_SCHEMA, } from '@angular/core';

describe('AddressDetailsComponent', () => {
let component: AddressDetailsComponent;
let fixture: ComponentFixture<AddressDetailsComponent>;

const addressesServiceSpy: jasmine.SpyObj<AddressesService> = jasmine.createSpyObj('AddressesService', ['get', 'getAddressesV2']);
const errorServiceSpy: jasmine.SpyObj<AddressesService> = jasmine.createSpyObj('ErrorService', ['renderServerErrors']);

beforeEach(async(() => {
addressesServiceSpy.get.and.returnValue(Observable.create());

TestBed.configureTestingModule({
declarations: [ AddressDetailsComponent ]
declarations: [
AddressDetailsComponent,
ExplorerCurrencyPipe,
ExplorerDatetimePipe
],
imports: [
RouterTestingModule,
TranslateModule.forRoot()
],
providers: [
{ provide: AddressesService, useValue: addressesServiceSpy },
{ provide: ErrorService, useValue: errorServiceSpy }
],
schemas: [NO_ERRORS_SCHEMA]
})
.compileComponents();
}));
Expand Down

0 comments on commit d5e1a6c

Please sign in to comment.