Skip to content

Commit c4e0577

Browse files
authored
Merge pull request #107 from input-output-hk/chore/add-test-ids-for-file-upload-component
chore: add test ids for file upload component
2 parents c66310d + d9d8fa2 commit c4e0577

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/design-system/file-upload/file-upload.component.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,20 @@ export const FileUpload = ({
4848
alignItems="center"
4949
justifyContent="center"
5050
>
51-
<UploadIcon />
51+
<UploadIcon data-testid="upload-icon" />
5252
</Flex>
5353
<Box w="$fill">
5454
<Box>
5555
<Box mb="$8">
56-
<Text.Body.Normal weight="$medium">{label}</Text.Body.Normal>
56+
<Text.Body.Normal weight="$medium" data-testid="file-upload-label">
57+
{label}
58+
</Text.Body.Normal>
5759
</Box>
58-
<Text.Body.Small color="secondary" weight="$medium">
60+
<Text.Body.Small
61+
color="secondary"
62+
weight="$medium"
63+
data-testid="supported-formats-label"
64+
>
5965
{supportedFormats}
6066
</Text.Body.Small>
6167
</Box>
@@ -65,13 +71,16 @@ export const FileUpload = ({
6571
{files.map((file, index) => (
6672
<Box key={file}>
6773
<Flex mb="$8">
68-
<Text.Body.Small weight="$medium">{file}</Text.Body.Small>
74+
<Text.Body.Small weight="$medium" data-testid={'file-name'}>
75+
{file}
76+
</Text.Body.Small>
6977
<Box className={cx.checkIconBox} ml="$8">
70-
<CheckFileUploadIcon />
78+
<CheckFileUploadIcon data-testid="check-icon" />
7179
</Box>
7280
</Flex>
7381
<button
7482
className={cx.removeButtonBox}
83+
data-testid="remove-button"
7584
onClick={(event): void => {
7685
if (onRemove) {
7786
event.preventDefault();

0 commit comments

Comments
 (0)