[835] Auto-save in new Item Submission form breaks the form

Submission form Save button disabled when no pending operations are present
This commit is contained in:
Alessandro Martelli
2020-11-27 16:25:41 +01:00
parent d47f686b95
commit de372896e7
8 changed files with 95 additions and 4 deletions

View File

@@ -224,6 +224,22 @@ describe('SubmissionFormFooterComponent Component', () => {
expect(depositBtn.nativeElement.disabled).toBeFalsy();
});
it('should disable save button when all modifications had been saved', () => {
comp.hasNotSavedModification = observableOf(false);
fixture.detectChanges();
const saveBtn: any = fixture.debugElement.query(By.css('#save'));
expect(saveBtn.nativeElement.disabled).toBeTruthy();
});
it('should enable save button when there are not saved modifications', () => {
comp.hasNotSavedModification = observableOf(true);
fixture.detectChanges();
const saveBtn: any = fixture.debugElement.query(By.css('#save'));
expect(saveBtn.nativeElement.disabled).toBeFalsy();
});
});
});