Browse Source

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

prometheus-integration
jonsadev 6 years ago
parent
commit
8a3669ef07
  1. 28
      web-ui/src/app/components/transaction-raw/transaction-raw.component.spec.ts

28
web-ui/src/app/components/transaction-raw/transaction-raw.component.spec.ts

@ -2,13 +2,39 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';
import { TransactionRawComponent } from './transaction-raw.component';
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('TransactionRawComponent', () => {
let component: TransactionRawComponent;
let fixture: ComponentFixture<TransactionRawComponent>;
const navigatorServiceSpy: jasmine.SpyObj<NavigatorService> = jasmine.createSpyObj('NavigatorService', ['']);
const transactionsServiceSpy: jasmine.SpyObj<TransactionsService> = jasmine.createSpyObj('TransactionsService', ['getRaw']);
const errorServiceSpy: jasmine.SpyObj<ErrorService> = jasmine.createSpyObj('ErrorService', ['renderServerErrors']);
beforeEach(async(() => {
transactionsServiceSpy.getRaw.and.returnValue(Observable.create());
TestBed.configureTestingModule({
declarations: [ TransactionRawComponent ]
declarations: [ TransactionRawComponent ],
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