Commit 354193e3 authored by tom's avatar tom

add test

parent af87fdbc
...@@ -4,6 +4,7 @@ import React from 'react'; ...@@ -4,6 +4,7 @@ import React from 'react';
import TestApp from 'playwright/TestApp'; import TestApp from 'playwright/TestApp';
import BlobData from './BlobData'; import BlobData from './BlobData';
import imageBlobWithZeroesBytes from './image_with_zeroes.blob';
test.use({ viewport: { width: 500, height: 300 } }); test.use({ viewport: { width: 500, height: 300 } });
...@@ -40,3 +41,13 @@ test('image', async({ mount }) => { ...@@ -40,3 +41,13 @@ test('image', async({ mount }) => {
await expect(component).toHaveScreenshot(); 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();
});
...@@ -92,7 +92,7 @@ const BlobData = ({ data, isLoading, hash }: Props) => { ...@@ -92,7 +92,7 @@ const BlobData = ({ data, isLoading, hash }: Props) => {
case 'Raw': case 'Raw':
return <RawDataSnippet data={ data } showCopy={ false } isLoading={ isLoading }/>; return <RawDataSnippet data={ data } showCopy={ false } isLoading={ isLoading }/>;
default: default:
return <span>fallback</span>; return <span/>;
} }
})(); })();
...@@ -125,7 +125,7 @@ const BlobData = ({ data, isLoading, hash }: Props) => { ...@@ -125,7 +125,7 @@ const BlobData = ({ data, isLoading, hash }: Props) => {
Download Download
</Button> </Button>
</Skeleton> </Skeleton>
<CopyToClipboard text={ JSON.stringify(data) } isLoading={ isLoading }/> <CopyToClipboard text={ data } isLoading={ isLoading }/>
</Flex> </Flex>
{ content } { content }
</GridItem> </GridItem>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment