[CST-5418] Improve notification when cannot deposit

This commit is contained in:
Giuseppe Digilio
2022-04-20 16:10:18 +02:00
parent 3a9d4fad95
commit c250408382
3 changed files with 12 additions and 2 deletions

View File

@@ -884,6 +884,7 @@ describe('SubmissionObjectEffects test suite', () => {
});
expect(submissionObjectEffects.saveAndDeposit$).toBeObservable(expected);
expect(notificationsServiceStub.warning).not.toHaveBeenCalled();
});
it('should return a SAVE_SUBMISSION_FORM_SUCCESS action when there are errors', () => {
@@ -910,10 +911,11 @@ describe('SubmissionObjectEffects test suite', () => {
submissionJsonPatchOperationsServiceStub.jsonPatchByResourceType.and.returnValue(observableOf(response));
const expected = cold('--b-', {
b: new SaveSubmissionFormSuccessAction(submissionId, response as any[])
b: new SaveSubmissionFormSuccessAction(submissionId, response as any[], false)
});
expect(submissionObjectEffects.saveAndDeposit$).toBeObservable(expected);
expect(notificationsServiceStub.warning).toHaveBeenCalled();
});
it('should catch errors and return a SAVE_SUBMISSION_FORM_ERROR', () => {