subscription = observable.subscribe(val => {
   expect(val).toBe(null);
   done();
 });
Ejemplo n.º 2
0
          .then((rootTC: any) => {
            let aboutDOMEl = rootTC.debugElement.children[0].nativeElement;

            expect(DOM.querySelectorAll(aboutDOMEl, 'h2')[0].textContent).toEqual('Features');
          });
Ejemplo n.º 3
0
 it('validates email', () => {
   const validEmail = new Control('*****@*****.**');
   const invalidEmail = new Control('test');
   expect(Validators.email(validEmail)).toBeUndefined();
   expect(Validators.email(invalidEmail)).toEqual({email: false});
 });
Ejemplo n.º 4
0
 it('should have id as assigned',() => {
     expect(employee.id).toEqual(1);
 });
Ejemplo n.º 5
0
      it('should call API to get collection of a known model', () => {
        apiService.getCollection('person');

        expect(apiService.getCollectionByUrl).toHaveBeenCalled();
        expect(apiService.getCollectionByUrl).toHaveBeenCalledWith('http://localhost:8000/people');
      });
Ejemplo n.º 6
0
 it('should get the meaning of life', inject([ReduxTwoApp], (app: ReduxTwoApp) => {
   expect(app.meaningOfLife()).toBe('The meaning of life is 42');
   expect(app.meaningOfLife(22)).toBe('The meaning of life is 22');
 }));
 return tcb.createAsync(UserListItemComponent).then((fixture: ComponentFixture) => {
   fixture.componentInstance.id = 15;
   fixture.componentInstance.viewDetails();
   expect(mockRouter.navigate).toHaveBeenCalledWith(['/UserDetail', {userId: 15}]);
 });
 return tcb.createAsync(AppComponent).then(fixture => {
   expect(fixture.componentInstance instanceof AppComponent).toBe(true, 'should create AppComponent');
 });
 it('is created', inject([SocketService], service => {
     expect(service).toBeDefined();
 }));
Ejemplo n.º 10
0
 it('should provide default id', inject([APP_ID], (id) => {
   expect(id).toBe('a');
 }));