Skip to content

Commit

Permalink
web-ui: Fix latest-blocks.component.spec
Browse files Browse the repository at this point in the history
  • Loading branch information
JonSalazar committed Jan 21, 2019
1 parent 22ced16 commit 8cfe906
Showing 1 changed file with 28 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,40 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { LatestBlocksComponent } from './latest-blocks.component';

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

import { BlocksService } from '../../services/blocks.service';
import { ErrorService } from '../../services/error.service';
import { Observable } from 'rxjs';

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

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

const blocksServiceSpy: jasmine.SpyObj<BlocksService> = jasmine.createSpyObj('BlocksService', ['getLatest']);
const errorServiceSpy: jasmine.SpyObj<ErrorService> = jasmine.createSpyObj('ErrorService', ['renderServerErrors']);

beforeEach(async(() => {
blocksServiceSpy.getLatest.and.returnValue(Observable.create());

TestBed.configureTestingModule({
declarations: [ LatestBlocksComponent ]
declarations: [
LatestBlocksComponent
],
imports: [
TranslateModule.forRoot(),
MomentModule,
RouterTestingModule
],
providers: [
{ provide: BlocksService, useValue: blocksServiceSpy },
{ provide: ErrorService, useValue: errorServiceSpy }
],
schemas: [NO_ERRORS_SCHEMA]
})
.compileComponents();
}));
Expand Down

0 comments on commit 8cfe906

Please sign in to comment.