Skip to content

Commit

Permalink
Merge pull request #26336 from qmonmert/angularthrow
Browse files Browse the repository at this point in the history
[Angular] Fix deprecated RxJS method (throwError)
  • Loading branch information
DanielFran authored Jun 3, 2024
2 parents 0fc196e + 365dea6 commit 110b4d8
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ describe('ActivateComponent', () => {
it('should set set error to true upon activation failure', inject(
[ActivateService],
fakeAsync((service: ActivateService) => {
jest.spyOn(service, 'get').mockReturnValue(throwError('ERROR'));
jest.spyOn(service, 'get').mockReturnValue(throwError(() => {}));

comp.ngOnInit();
tick();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ describe('PasswordResetFinishComponent', () => {
it('should notify of generic error', inject(
[PasswordResetFinishService],
fakeAsync((service: PasswordResetFinishService) => {
jest.spyOn(service, 'save').mockReturnValue(throwError('ERROR'));
jest.spyOn(service, 'save').mockReturnValue(throwError(() => {}));
comp.passwordForm.patchValue({
newPassword: 'password',
confirmPassword: 'password',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ describe('PasswordComponent', () => {

it('should notify of error if change password fails', () => {
// GIVEN
jest.spyOn(service, 'save').mockReturnValue(throwError('ERROR'));
jest.spyOn(service, 'save').mockReturnValue(throwError(() => {}));
comp.passwordForm.patchValue({
newPassword: 'myPassword',
confirmPassword: 'myPassword',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ describe('SettingsComponent', () => {

it('should notify of error upon failed save', () => {
// GIVEN
mockAccountService.save = jest.fn(() => throwError('ERROR'));
mockAccountService.save = jest.fn(() => throwError(() => {}));

// WHEN
comp.ngOnInit();
Expand Down

0 comments on commit 110b4d8

Please sign in to comment.