[ADF-4481] Fix Viewer peview for unsupported new versions (#6101)

* [ADF-4481] Fix Viewer peview for unsupported new versions

* Update img-viewer.component.ts
This commit is contained in:
davidcanonieto
2020-09-08 18:28:46 +02:00
committed by GitHub
parent 722e28bc0d
commit 6977df169a
7 changed files with 180 additions and 107 deletions

View File

@@ -878,6 +878,21 @@ describe('ViewerComponent', () => {
component.ngOnChanges();
});
it('should swicth to the unkwown template if the type specific viewers throw an error', (done) => {
component.urlFile = 'fake-url-file.icns';
component.mimeType = 'image/png';
component.ngOnChanges();
fixture.detectChanges();
component.onUnsupportedFile();
fixture.detectChanges();
fixture.whenStable().then(() => {
fixture.detectChanges();
expect(element.querySelector('adf-viewer-unknown-format')).toBeDefined();
done();
});
});
});
describe('Events', () => {