Add additional test for no server error

This commit is contained in:
Will Abson 2016-10-25 18:10:53 +01:00
parent b90c676bc9
commit 68fc93ecbc

View File

@ -77,4 +77,16 @@ describe('AlfrescoSearchService', () => {
);
});
it('should notify a general error if the API does not return a specific error', (done) => {
spyOn(fakeApi.core.searchApi, 'liveSearchNodes').and.returnValue(Promise.reject(null));
service.getLiveSearchResults('').subscribe(
() => {},
(res: any) => {
expect(res).toBeDefined();
expect(res).toEqual('Server error');
done();
}
);
});
});