// import { Observable } from 'rxjs/Observable'; // import { HomeComponent } from './home.component'; // import { NameListService } from '../name-list/name-list.service'; // import { TestableModule } from '../shared/baseshared/components/test.base.module'; // describe('Home Component', () => { // const html = ''; // beforeEach(() => { // TestBed.configureTestingModule({imports: [FormsModule, TestableModule], declarations: [HomeComponent, TestComponent], // providers: [ // { provide: NameListService, useValue: new MockNameListService() } // ] // }); // TestBed.overrideComponent(TestComponent, { set: { template: html }}); // }); // it('should have p tag with list of scientists...', () => { // const fixture = TestBed.createComponent(TestComponent); // fixture.detectChanges(); // expect(fixture.nativeElement.children[0].textContent).toContain("Howdy! Here's a list of awesome computer scientists. Do you know any others? Add to the list yourself."); // }); // it('should work home component', () => { // TestBed // .compileComponents() // .then(() => { // let fixture = TestBed.createComponent(HomeComponent); // let homeInstance = fixture.debugElement.componentInstance; // let homeDOMEl = fixture.debugElement.nativeElement; // let mockNameListService = fixture.debugElement.injector.get(NameListService); // let nameListServiceSpy = spyOn(mockNameListService, 'get').and.callThrough(); // console.log('Home Componenet Test**********'); // mockNameListService.returnValue = ['1', '2', '3']; // fixture.detectChanges(); // expect(homeInstance.nameListService).toEqual(jasmine.any(MockNameListService)); // expect(homeDOMEl.querySelectorAll('li').length).toEqual(3); // expect(nameListServiceSpy.calls.count()).toBe(1); // homeInstance.newName = 'Minko'; // homeInstance.addName(); // fixture.detectChanges(); // expect(homeDOMEl.querySelectorAll('li').length).toEqual(4); // expect(homeDOMEl.querySelectorAll('li')[3].textContent).toEqual('Minko'); // }); // }); // }); // @Component({selector: 'my-test', template: ''}) // class TestComponent { } // class MockNameListService { // returnValue: string[]; // get(): Observable { // return Observable.create((observer: any) => { // observer.next(this.returnValue); // observer.complete(); // }); // } // }