NetanelBasal
4/22/2017 - 7:53 PM

et6.ts

describe('get$', () => {
  it('should return a GET_POSTS_SUCCESS action, with the posts, on success', () => {
  
    const postsToReturn = [{
      id: 1
    }];
    
    postsService.get.and.returnValue(Observable.of(postsToReturn));

    const expectedResult = getPostsSuccess(postsToReturn);

    runner.queue(getPosts());

    postsEffects.get$.subscribe(result => {
      expect(result).toEqual(expectedResult);
    });
    
  });
});