Skip to content

Commit

Permalink
[ACS-8823] Viewer - do not show non responsive dialog if blobFile was…
Browse files Browse the repository at this point in the history
… provided
  • Loading branch information
nikita-web-ua committed Sep 25, 2024
1 parent ac5bbfa commit f527b5b
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 8 additions & 0 deletions lib/core/src/lib/viewer/components/viewer.component.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,14 @@ describe('ViewerComponent', () => {
expect(dialogOpenSpy).toHaveBeenCalled();
}));

it('should not show non responsive dialog if blobFile was provided', fakeAsync(() => {
component.blobFile = new Blob(['mock content'], { type: 'text/plain' });
fixture.detectChanges();
tick(3000);
fixture.detectChanges();
expect(dialogOpenSpy).not.toHaveBeenCalled();
}));

it('should show reminder non responsive dialog after initial dialog', fakeAsync(() => {
dialogOpenSpy.and.returnValue({ afterClosed: () => of(DownloadPromptActions.WAIT) } as any);
fixture.detectChanges();
Expand Down
2 changes: 1 addition & 1 deletion lib/core/src/lib/viewer/components/viewer.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ export class ViewerComponent<T> implements OnDestroy, OnInit, OnChanges {
}

private showOrClearDownloadPrompt() {
if (!this.urlFile) {
if (!this.urlFile && !this.blobFile) {
this.showDownloadPrompt();
} else {
this.clearDownloadPromptTimeouts();
Expand Down

0 comments on commit f527b5b

Please sign in to comment.