[ADF-4953] Uploader - confirmation dialog actions should return focus to the upload dialog (#5148)

* trap confirmation dialog

* focus dialog when not in confirmation state

* test
This commit is contained in:
Cilibiu Bogdan
2019-10-14 13:18:17 +03:00
committed by Eugenio Romano
parent b1bccdb0e3
commit 1d7ef62095
4 changed files with 29 additions and 3 deletions

View File

@@ -164,6 +164,26 @@ describe('FileUploadingDialogComponent', () => {
expect(component.isDialogMinimized).toBe(false);
});
it('should focus on dialog when coming from confirmation', fakeAsync(() => {
uploadService.addToQueue(...fileList);
uploadService.uploadFilesInTheQueue(emitter);
fixture.detectChanges();
tick(100);
component.toggleConfirmation();
fixture.detectChanges();
tick(100);
expect(document.activeElement.id).not.toBe('upload-dialog');
component.toggleConfirmation();
fixture.detectChanges();
tick(100);
expect(document.activeElement.id).toBe('upload-dialog');
}));
});
describe('cancelAllUploads()', () => {