mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ACS-6190] prefer-promise-reject-errors rule and fixes (#9021)
* fix promise rejections * fix promise errors * promise error fixes * fix promise rejections * [ci:force] fix formatting * test fixes * [ci:force] fix tests * [ci:force] fix tests * fix incorrect return types * meaningful errors * remove useless pipe * fix accessing private members in the test
This commit is contained in:
@@ -469,7 +469,7 @@ describe('LoginComponent', () => {
|
||||
});
|
||||
|
||||
it('should return error with a wrong username', (done) => {
|
||||
spyOn(alfrescoApiService.getInstance(), 'login').and.returnValue(Promise.reject());
|
||||
spyOn(alfrescoApiService.getInstance(), 'login').and.returnValue(Promise.reject(new Error('login error')));
|
||||
|
||||
component.error.subscribe(() => {
|
||||
fixture.detectChanges();
|
||||
@@ -484,7 +484,7 @@ describe('LoginComponent', () => {
|
||||
});
|
||||
|
||||
it('should return error with a wrong password', (done) => {
|
||||
spyOn(alfrescoApiService.getInstance(), 'login').and.returnValue(Promise.reject());
|
||||
spyOn(alfrescoApiService.getInstance(), 'login').and.returnValue(Promise.reject(new Error('login error')));
|
||||
|
||||
component.error.subscribe(() => {
|
||||
fixture.detectChanges();
|
||||
@@ -500,7 +500,7 @@ describe('LoginComponent', () => {
|
||||
});
|
||||
|
||||
it('should return error with a wrong username and password', (done) => {
|
||||
spyOn(alfrescoApiService.getInstance(), 'login').and.returnValue(Promise.reject());
|
||||
spyOn(alfrescoApiService.getInstance(), 'login').and.returnValue(Promise.reject(new Error('login error')));
|
||||
|
||||
component.error.subscribe(() => {
|
||||
fixture.detectChanges();
|
||||
|
Reference in New Issue
Block a user