These are chat archives for AngularClass/angular2-webpack-starter

Jul 2017
Jul 19 2017 21:26
@all can you tell me how to write test case for the below file
Jul 19 2017 21:53
  • I am new to angular 2 and I am writing test case.
  • actual functionality code I am providing in fiddle
  • when i add console in the test case its not showing in the terminal.
  • providing my code below
  • can you tell how to fix it
import {ComponentFixture, TestBed, async,fakeAsync,inject} from '@angular/core/testing';
import { BrowserModule } from '@angular/platform-browser';
import {By} from "@angular/platform-browser";
import {DebugElement} from "@angular/core";
import { MockBackend,  MockConnection } from '@angular/http/testing';
import { HttpModule, Http, XHRBackend, Response, ResponseOptions } from '@angular/http';
import { Observable } from 'rxjs/Observable';
import {Component, ElementRef,OnInit,ViewChild} from '@angular/core';
import { SPORTSService } from '../../app/services/sports.service';
import {KendoGridComponent} from '../../app/components/grid/grid.component';

import {Signal} from '../../app/components/financials/finance-dashboard-title';

describe("sports titke search", () => {


  let Component: KendoGridComponent;
  let Fixture: ComponentFixture<KendoGridComponent>;
  let textDebugElement: DebugElement;
  let textElement: HTMLElement;

  beforeEach(async(() => {

          imports: [ HttpModule ],
                  providers:[DecodeService,SPORTSService,jumpService,saveService,TranslateService,TRANSLATION_PROVIDERS,{ provide: XHRBackend, useClass: MockBackend }]
    }).compileComponents().then(() =>{
    Fixture = TestBed.createComponent(KendoGridComponent);
    Component = Fixture.componentInstance;


  it("jump criteria search",()=>{
      let data= "{jumpId:0,operationType:search,jumpsDto:null,jumpsSearch:{networks:[1],title:'',titleType:,titleSubType:'',distributorName:'',jumpNumber:'',jumpStatus:'',jumpReference:'',packageName:''}}";
    //let data = "ssoId:&name:&networkNo:1&deptRole:292&status:active&accessNetwork:2&permissionLevelId:1";
    Component._dataSource = new