[ADF-2455] Fallback thumbnail fix (#3164)

* Show default icon when thumbnail image is broken

* Remove thumbnails prop from demo-shell

* Unit test added
This commit is contained in:
Alex Bolboșenco
2018-04-10 20:27:21 +03:00
committed by Denys Vuika
parent c214054767
commit 12df7500da
3 changed files with 23 additions and 3 deletions

View File

@@ -739,6 +739,17 @@ describe('DataTable', () => {
expect(event.target.src).toBe(originalSrc);
});
it('should replace image source with icon if fallback is not available and mimeType is provided', () => {
let event = <any> {
target: {
src: 'missing-image'
}
};
dataTable.onImageLoadingError(event, 'image/png');
expect(event.target.src).toBe('./assets/images/ft_ic_raster_image.svg');
});
it('should not get cell tooltip when row is not provided', () => {
const col = <DataColumn> { key: 'name', type: 'text' };
expect(dataTable.getCellTooltip(null, col)).toBeNull();