diff --git a/web-ui/src/app/components/block-raw/block-raw.component.spec.ts b/web-ui/src/app/components/block-raw/block-raw.component.spec.ts index 623118b..5c8f701 100644 --- a/web-ui/src/app/components/block-raw/block-raw.component.spec.ts +++ b/web-ui/src/app/components/block-raw/block-raw.component.spec.ts @@ -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; + const navigatorServiceSpy: jasmine.SpyObj = jasmine.createSpyObj('NavigatorService', ['']); + const blocksServiceSpy: jasmine.SpyObj = jasmine.createSpyObj('BlocksService', ['getRaw']); + const errorServiceSpy: jasmine.SpyObj = 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(); }));