Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
354193e3
Commit
354193e3
authored
Mar 14, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add test
parent
af87fdbc
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
2 deletions
+16
-2
BlobData.pw.tsx
ui/blob/BlobData.pw.tsx
+11
-0
BlobData.tsx
ui/blob/BlobData.tsx
+2
-2
BlobData.pw.tsx_default_image-blob-with-zeroes-bytes-1.png
...lobData.pw.tsx_default_image-blob-with-zeroes-bytes-1.png
+0
-0
image_with_zeroes.blob.ts
ui/blob/image_with_zeroes.blob.ts
+3
-0
No files found.
ui/blob/BlobData.pw.tsx
View file @
354193e3
...
@@ -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
();
});
ui/blob/BlobData.tsx
View file @
354193e3
...
@@ -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
>
...
...
ui/blob/__screenshots__/BlobData.pw.tsx_default_image-blob-with-zeroes-bytes-1.png
0 → 100644
View file @
354193e3
112 KB
ui/blob/image_with_zeroes.blob.ts
0 → 100644
View file @
354193e3
This source diff could not be displayed because it is too large. You can
view the blob
instead.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment