This commit is contained in:
tom
2024-03-14 11:38:38 +04:00
parent cc5ba81d77
commit f4137c351e
4 changed files with 16 additions and 2 deletions
+11
View File
@@ -4,6 +4,7 @@ import React from 'react';
import TestApp from 'playwright/TestApp';
import BlobData from './BlobData';
import imageBlobWithZeroesBytes from './image_with_zeroes.blob';
test.use({ viewport: { width: 500, height: 300 } });
@@ -40,3 +41,13 @@ test('image', async({ mount }) => {
await expect(component).toHaveScreenshot();
});
test('image blob with zeroes bytes', async({ mount }) => {
const component = await mount(
<TestApp>
<BlobData hash="0x01" data={ imageBlobWithZeroesBytes }/>
</TestApp>,
);
await expect(component).toHaveScreenshot();
});
+2 -2
View File
@@ -92,7 +92,7 @@ const BlobData = ({ data, isLoading, hash }: Props) => {
case 'Raw':
return <RawDataSnippet data={ data } showCopy={ false } isLoading={ isLoading }/>;
default:
return <span>fallback</span>;
return <span/>;
}
})();
@@ -125,7 +125,7 @@ const BlobData = ({ data, isLoading, hash }: Props) => {
Download
</Button>
</Skeleton>
<CopyToClipboard text={ JSON.stringify(data) } isLoading={ isLoading }/>
<CopyToClipboard text={ data } isLoading={ isLoading }/>
</Flex>
{ content }
</GridItem>
Binary file not shown.

After

Width:  |  Height:  |  Size: 112 KiB

File diff suppressed because one or more lines are too long