Browse Source

web-ui: Fix transaction-details.component.spec

prometheus-integration
jonsadev 6 years ago
parent
commit
56ff5bf94d
  1. 34
      web-ui/src/app/components/transaction-details/transaction-details.component.spec.ts

34
web-ui/src/app/components/transaction-details/transaction-details.component.spec.ts

@ -1,14 +1,46 @@
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TransactionDetailsComponent } from './transaction-details.component';
import { ExplorerDatetimePipe } from '../../pipes/explorer-datetime.pipe';
import { ExplorerCurrencyPipe } from '../../pipes/explorer-currency.pipe';
import { TranslateModule } from '@ngx-translate/core';
import { RouterTestingModule } from '@angular/router/testing';
import { NavigatorService } from '../../services/navigator.service';
import { TransactionsService } from '../../services/transactions.service';
import { ErrorService } from '../../services/error.service';
import { Observable } from 'rxjs';
import { NO_ERRORS_SCHEMA, } from '@angular/core';
describe('TransactionDetailsComponent', () => {
let component: TransactionDetailsComponent;
let fixture: ComponentFixture<TransactionDetailsComponent>;
const navigatorServiceSpy: jasmine.SpyObj<NavigatorService> = jasmine.createSpyObj('NavigatorService', ['']);
const transactionsServiceSpy: jasmine.SpyObj<TransactionsService> = jasmine.createSpyObj('TransactionsService', ['get']);
const errorServiceSpy: jasmine.SpyObj<ErrorService> = jasmine.createSpyObj('ErrorService', ['renderServerErrors']);
beforeEach(async(() => {
transactionsServiceSpy.get.and.returnValue(Observable.create());
TestBed.configureTestingModule({
declarations: [ TransactionDetailsComponent ]
declarations: [
TransactionDetailsComponent,
ExplorerDatetimePipe,
ExplorerCurrencyPipe
],
imports: [
TranslateModule.forRoot(),
RouterTestingModule
],
providers: [
{ provide: NavigatorService, useValue: navigatorServiceSpy },
{ provide: TransactionsService, useValue: transactionsServiceSpy },
{ provide: ErrorService, useValue: errorServiceSpy },
],
schemas: [NO_ERRORS_SCHEMA]
})
.compileComponents();
}));

Loading…
Cancel
Save