Skip to content

Commit

Permalink
fix: display error message when resource loading fails (#19622)
Browse files Browse the repository at this point in the history
CXSPA-8939
  • Loading branch information
FollowTheFlo authored Nov 29, 2024
1 parent b32ecac commit 5467c2d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,10 @@ describe('OpfResourceLoaderService', () => {
}
);

opfResourceLoaderService.loadResources([mockScriptResource]);
opfResourceLoaderService
.loadResources([mockScriptResource])
.then(() => {})
.catch(() => {});

expect(opfResourceLoaderService['loadStyles']).not.toHaveBeenCalled();
expect(opfResourceLoaderService['loadScript']).toHaveBeenCalled();
Expand Down Expand Up @@ -207,7 +210,10 @@ describe('OpfResourceLoaderService', () => {
}
);

opfResourceLoaderService.loadResources([], [mockStylesResources]);
opfResourceLoaderService
.loadResources([], [mockStylesResources])
.then(() => {})
.catch(() => {});

expect(opfResourceLoaderService['loadScript']).not.toHaveBeenCalled();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,6 @@ export class OpfResourceLoaderService {
}
);

return Promise.all(resourcesPromises)
.then(() => {})
.catch(() => {});
return Promise.all(resourcesPromises).then(() => {});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ export class OpfCheckoutPaymentWrapperService {
if (html) {
this.executeScriptFromHtml(html);
}
})
.catch(() => {
this.handleGeneralPaymentError().pipe(take(1)).subscribe();
});
return;
}
Expand Down

0 comments on commit 5467c2d

Please sign in to comment.