mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
add test
This commit is contained in:
@@ -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();
|
||||
});
|
||||
|
||||
@@ -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
Reference in New Issue
Block a user