Skip to content

Commit

Permalink
fix: test putting alerts too
Browse files Browse the repository at this point in the history
  • Loading branch information
kemuru committed Oct 10, 2024
1 parent 25b658a commit ae2d2b1
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/components/new-arbitrable-tx/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ const NewArbitrableTx = ({ formArbitrabletx, accounts, balance, tokens, template
if (values.description.length < 1)
errors.description =
'Description is required.'
if (showFileUpload && values.file.size > 1024 * 1024 * 4)
if (showFileUpload && values.file.size > 1024 * 1024 * 4) {
errors.file = 'The file is too big. The maximum size is 4MB.'
alert('The file is too big. The maximum size is 4MB.')
}
for (let extraDetailsKeys of Object.keys(template.optionalInputs)) {
if (!values.extraData[extraDetailsKeys])
errors[extraDetailsKeys] = 'Field required'
Expand Down
4 changes: 3 additions & 1 deletion src/components/new-evidence-arbitrable-tx/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ const NewEvidenceArbitrableTx = ({ submitEvidence, arbitrable, id }) => (
if (values.description.length > 255)
errors.description =
'The description is too long. The maximum length is 255 characters.'
if (values.file.size > 1024 * 1024 * 4)
if (values.file.size > 1024 * 1024 * 4) {
errors.file = 'The file is too big. The maximum size is 4MB.'
alert('The file is too big. The maximum size is 4MB.')
}
return errors
}}
// eslint-disable-next-line react/jsx-no-bind
Expand Down
4 changes: 3 additions & 1 deletion src/components/new-invoice-arbitrable-tx/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ const NewInvoiceArbitrableTx = ({ formArbitrabletx, accounts }) => {
if (values.description.length > 1000000)
errors.description =
'The description is too long. The maximum length is 1,000,000 characters.'
if (values.file.size > 1024 * 1024 * 4)
if (values.file.size > 1024 * 1024 * 4) {
errors.file = 'The file is too big. The maximum size is 4MB.'
alert('The file is too big. The maximum size is 4MB.')
}
return errors
}}
// eslint-disable-next-line react/jsx-no-bind
Expand Down

0 comments on commit ae2d2b1

Please sign in to comment.