Skip to content

Commit

Permalink
web-ui: Fix block-raw.component.spec
Browse files Browse the repository at this point in the history
  • Loading branch information
JonSalazar committed Jan 21, 2019
1 parent 417667d commit ce358d7
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion web-ui/src/app/components/block-raw/block-raw.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,42 @@ import { async, ComponentFixture, TestBed } from '@angular/core/testing';

import { BlockRawComponent } from './block-raw.component';

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

import { NavigatorService } from './../../services/navigator.service';
import { BlocksService } from '../../services/blocks.service';
import { ErrorService } from '../../services/error.service';
import { TranslateService } from '@ngx-translate/core';

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

import { Observable } from 'rxjs';

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

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

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

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

0 comments on commit ce358d7

Please sign in to comment.