UNPKG

uv-charts-dashboard

Version:
47 lines 1.82 kB
"use strict"; var __extends = (this && this.__extends) || function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; var testing_1 = require('@angular/core/testing'); var line_chart_component_1 = require('./line-chart.component'); var common_service_1 = require('../../shared/common.service'); var Observable_1 = require('rxjs/Observable'); var comp; var fixture; var de; var el; var commonService, spy; var MockCommonService = (function (_super) { __extends(MockCommonService, _super); function MockCommonService() { _super.call(this, name); } MockCommonService.prototype.getRealTimeData = function () { return new Observable_1.Observable(function (observer) { setTimeout(function () { observer.next(1); }, 1000); }); }; return MockCommonService; }(common_service_1.CommonService)); describe('line chart component', function () { beforeEach(function () { testing_1.TestBed.configureTestingModule({ declarations: [line_chart_component_1.LineChartComponent], providers: [ { provide: common_service_1.CommonService, useClass: MockCommonService } ] }); fixture = testing_1.TestBed.createComponent(line_chart_component_1.LineChartComponent); comp = fixture.componentInstance; // commonService actually injected into the component commonService = fixture.debugElement.injector.get(common_service_1.CommonService); }); it('should create LineChartComponent', function () { expect('true').toBe('true'); }); }); //# sourceMappingURL=line-chart.component.spec.js.map