mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
Viewer renderer stop loading when subsequent renderer throws error (#10931)
* Viewer renderer stop loading when subsequent renderer throws error * Update lib/core/src/lib/viewer/components/viewer-render/viewer-render.component.spec.ts * CR fix --------- Co-authored-by: Michaela <85624192+mkrbr@users.noreply.github.com>
This commit is contained in:
@@ -537,5 +537,16 @@ describe('ViewerComponent', () => {
|
|||||||
expect(component.viewerType).toBe('image');
|
expect(component.viewerType).toBe('image');
|
||||||
expect(component.markAsLoaded).toHaveBeenCalled();
|
expect(component.markAsLoaded).toHaveBeenCalled();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should not show spinner and set viewerType to unknown if subsequent renderer throws an error', () => {
|
||||||
|
component.urlFile = 'some-url.png';
|
||||||
|
fixture.detectChanges();
|
||||||
|
expect(getMainLoader()).not.toBeNull();
|
||||||
|
|
||||||
|
component.onUnsupportedFile();
|
||||||
|
fixture.detectChanges();
|
||||||
|
expect(getMainLoader()).toBeNull();
|
||||||
|
expect(component.viewerType).toBe('unknown');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -235,6 +235,7 @@ export class ViewerRenderComponent implements OnChanges, OnInit {
|
|||||||
|
|
||||||
onUnsupportedFile() {
|
onUnsupportedFile() {
|
||||||
this.viewerType = 'unknown';
|
this.viewerType = 'unknown';
|
||||||
|
this.isLoading = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
onClose() {
|
onClose() {
|
||||||
|
Reference in New Issue
Block a user