-
Notifications
You must be signed in to change notification settings - Fork 9
[MWPW-175541] Improve Unit Tests #496
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
Commits
|
* stage: IMS error logging improvement - Phase 1 (#493) [MWPW-173462] Loading screen: Text should not be marked as a heading (#487) Allow empty query (#488) Sending error object in addition to error message in case of IMS token failures (#486) [MWPW-174632] Getting 'unable to process the request' error toast for 'Empty File + Max File Size' upload for 2b/2c (#476) [MWPW-171797] Introduce timeout to all fetch calls being made (#484) Fix for workflow getting stuck at transition screen if asset api fails (#481) Fix CSS issues found during launch (#482) [MWPW-174834] Added pdf file support in ocr. Was a miss from the last PR. (#483) [MWPW-174834] Fallback to file extension if MIME type is absent for determining file type (#480) [MWPW-174783] Fix error message issue on Japanese page (#478) [MWPW-172186] Phase 2 of accessibility fix for transition screen (#460) # Conflicts: # unitylibs/core/workflow/workflow-acrobat/action-binder.js # unitylibs/utils/FileUtils.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
eslint
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.
fillsign: ['single','page-limit-100'], |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.
'split-pdf': ['single', 'max-filesize-1-gb','split-pdf-page-limits','signedInallowedFileTypes'], |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.
'split-pdf': ['single', 'max-filesize-1-gb','split-pdf-page-limits','signedInallowedFileTypes'], |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 198 to 199 in c008dbf
'chat-pdf-student': ['hybrid', 'allowed-filetypes-pdf-word-ppt-txt', 'page-limit-600', 'max-numfiles-10', 'max-filesize-100-mb'] | |
}; |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'error_generic' found.
'error_generic': 'verb_upload_error_generic', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'pre_upload_error_loading_verb_limits' found.
'pre_upload_error_loading_verb_limits': 'verb_upload_error_loading_verb_limits', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'pre_upload_error_empty_verb_limits' found.
'pre_upload_error_empty_verb_limits': 'verb_upload_error_empty_verb_limits', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'pre_upload_error_renaming_file' found.
'pre_upload_error_renaming_file': 'verb_upload_error_renaming_file', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'pre_upload_error_fetch_redirect_url' found.
'pre_upload_error_fetch_redirect_url': 'verb_upload_error_fetch_redirect_url', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_validate_files' found.
'validation_error_validate_files': 'verb_upload_error_validate_files', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_unsupported_type' found.
'validation_error_unsupported_type': 'verb_upload_error_unsupported_type', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_empty_file' found.
'validation_error_empty_file': 'verb_upload_error_empty_file', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_file_too_large' found.
'validation_error_file_too_large': 'verb_upload_error_file_too_large', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_only_accept_one_file' found.
'validation_error_only_accept_one_file': 'verb_upload_error_only_accept_one_file', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_file_same_type' found.
'validation_error_file_same_type': 'verb_upload_error_file_same_type', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_unsupported_type_multi' found.
'validation_error_unsupported_type_multi': 'verb_upload_error_unsupported_type_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_empty_file_multi' found.
'validation_error_empty_file_multi': 'verb_upload_error_empty_file_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_file_too_large_multi' found.
'validation_error_file_too_large_multi': 'verb_upload_error_file_too_large_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_multiple_invalid_files' found.
'validation_error_multiple_invalid_files': 'verb_upload_error_multiple_invalid_files', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_max_num_files' found.
'validation_error_max_num_files': 'verb_upload_error_max_num_files', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_file_same_type_multi' found.
'validation_error_file_same_type_multi': 'verb_upload_error_file_same_type_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_max_page_count' found.
'upload_validation_error_max_page_count': 'verb_upload_error_max_page_count', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_min_page_count' found.
'upload_validation_error_min_page_count': 'verb_upload_error_min_page_count', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_verify_page_count' found.
'upload_validation_error_verify_page_count': 'verb_upload_error_verify_page_count', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_max_page_count_multi' found.
'upload_validation_error_max_page_count_multi': 'verb_upload_error_max_page_count_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_duplicate_asset' found.
'upload_validation_error_duplicate_asset': 'verb_upload_error_duplicate_asset', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_max_quota_exceeded' found.
'upload_error_max_quota_exceeded': 'verb_upload_error_max_quota_exceeded', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_no_storage_provision' found.
'upload_error_no_storage_provision': 'verb_upload_error_no_storage_provision', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_chunk_upload' found.
'upload_error_chunk_upload': 'verb_upload_error_chunk_upload', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_finalize_asset' found.
'upload_error_finalize_asset': 'verb_upload_error_finalize_asset', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_redirect_to_app' found.
'upload_error_redirect_to_app': 'verb_upload_error_redirect_to_app', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_warn_chunk_upload' found.
'upload_warn_chunk_upload': 'verb_upload_warn_chunk_upload', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'pre_upload_warn_renamed_invalid_file_name' found.
'pre_upload_warn_renamed_invalid_file_name': 'verb_warn_renamed_invalid_file_name', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'warn_delete_asset' found.
'warn_delete_asset': 'verb_upload_warn_delete_asset', |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 345 to 346 in c008dbf
getMetadata: `${unityConfig.apiEndPoint}/asset/metadata` | |
}; |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 384 to 385 in c008dbf
desc: errorMetaData.desc || message || undefined | |
}, |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
There should be no space before ','.
const detail = { event: eventName, ...(data && { data }) , sendToSplunk }; |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
fileName = DOS_SPECIAL_NAMES.has(nameWithoutExtension.toUpperCase()) |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
? `---${ext}` |
🚫 [eslint] <semi> reported by reviewdog 🐶
Missing semicolon.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 426 to 427 in c008dbf
await this.dispatchErrorToast('pre_upload_warn_renamed_invalid_file_name', null, `Renamed ${rawFileName} to ${fileName}`, true) | |
} |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
return multiFileErrorMessage.endsWith('_multi') |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
? multiFileErrorMessage.slice(0, -6) |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
await this.dispatchErrorToast('validation_error_max_num_files', null, `Maximum ${this.limits.maxNumFiles} files allowed`, false, true, { |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
code: 'validation_error_validate_files', |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 466 to 467 in c008dbf
subCode: 'validation_error_max_num_files' | |
}); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
return { isValid: false, validFiles}; |
🚫 [eslint] <keyword-spacing> reported by reviewdog 🐶
Expected space(s) after "if".
if(!(cOpts.payload.feedback)) { |
🚫 [eslint] <quotes> reported by reviewdog 🐶
Strings must use singlequote.
if (this.multiFileValidationFailure) cOpts.payload.feedback = "uploaderror"; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.
this.dispatchAnalyticsEvent('redirectUrl', {...filesData, redirectUrl: this.redirectUrl}); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
this.dispatchAnalyticsEvent('redirectUrl', {...filesData, redirectUrl: this.redirectUrl}); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.
this.filesData = {...this.filesData,uploadType: 'sfu'}; |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.
this.filesData = {...this.filesData,uploadType: 'sfu'}; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
this.filesData = {...this.filesData,uploadType: 'sfu'}; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.
this.filesData = {...this.filesData,uploadType: 'mfu'}; |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.
this.filesData = {...this.filesData,uploadType: 'mfu'}; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
this.filesData = {...this.filesData,uploadType: 'mfu'}; |
🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'if' condition.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 628 to 631 in c008dbf
if (!combinedLimits || Object.keys(combinedLimits).length === 0) await this.dispatchErrorToast('error_generic', 500, 'No verb limits found', false, true, { | |
code: 'pre_upload_error_empty_verb_limits', | |
desc: 'No verb limits found', | |
}); |
🚫 [eslint] <eol-last> reported by reviewdog 🐶
Newline required at end of file but not found.
🚫 [eslint] <no-multiple-empty-lines> reported by reviewdog 🐶
More than 1 blank line not allowed.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 51 to 52 in c008dbf
async uploadFileToUnityWithRetry(url, blobData, fileType, assetId, signal, chunkNumber = 0) { |
🚫 [eslint] <no-plusplus> reported by reviewdog 🐶
Unary operator '++' used.
for (let attempt = 1; attempt <= maxRetries; attempt++) { |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 109. Maximum allowed is 100.
const response = await this.uploadFileToUnity(url, blobData, fileType, assetId, signal, chunkNumber); |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
} catch (err) { |
🚫 [eslint] <no-loop-func> reported by reviewdog 🐶
Function declared in a loop contains unsafe references to variable(s) 'retryDelay'.
await new Promise(resolve => setTimeout(resolve, retryDelay)); |
🚫 [eslint] <arrow-parens> reported by reviewdog 🐶
Expected parentheses around arrow function argument.
await new Promise(resolve => setTimeout(resolve, retryDelay)); |
🚫 [eslint] <no-promise-executor-return> reported by reviewdog 🐶
Return values from promise executor functions cannot be read.
await new Promise(resolve => setTimeout(resolve, retryDelay)); |
🚫 [eslint] <operator-assignment> reported by reviewdog 🐶
Assignment (=) can be replaced with operator assignment (+=).
if (error) error.message = error.message + ', Max retry delay exceeded during upload'; |
🚫 [eslint] <prefer-template> reported by reviewdog 🐶
Unexpected string concatenation.
if (error) error.message = error.message + ', Max retry delay exceeded during upload'; |
🚫 [eslint] <object-shorthand> reported by reviewdog 🐶
Expected property shorthand.
signal: signal |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 88 to 89 in c008dbf
signal: signal | |
}; |
🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'if' condition.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 112 to 116 in c008dbf
} else if (['Timeout'].includes(e.name)) await this.actionBinder.dispatchErrorToast('upload_warn_chunk_upload', 504, `Timeout when uploading chunk to storage; ${assetId}, ${blobData.size} bytes`, true, true, { | |
code: 'upload_warn_chunk_upload', | |
subCode: chunkNumber, | |
desc: `Timeout when uploading chunk to storage; ${assetId}, ${blobData.size} bytes; status: ${e.status}`, | |
}); else { |
🚫 [eslint] <consistent-return> reported by reviewdog 🐶
Expected to return a value at the end of async arrow function.
return async () => { |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 142. Maximum allowed is 100.
const { attempt } = await this.uploadFileToUnityWithRetry(url.href, chunk, fileType, assetData.id, signal, parseInt(chunkNumber)); |
🚫 [eslint] <radix> reported by reviewdog 🐶
Missing radix parameter.
const { attempt } = await this.uploadFileToUnityWithRetry(url.href, chunk, fileType, assetData.id, signal, parseInt(chunkNumber)); |
🚫 [eslint] <object-shorthand> reported by reviewdog 🐶
Expected property shorthand.
{ body: JSON.stringify(finalAssetData), signal: signal }, |
🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.
async checkPageNumCount(assetData, isMultiFile=false) { |
🚫 [eslint] <no-use-before-define> reported by reviewdog 🐶
'timeoutId' was used before it was defined.
clearTimeout(timeoutId); |
🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.
async handleUploadError(e, errorCode='error_generic') { |
🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'else'.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 368 to 372 in c008dbf
else await this.actionBinder.dispatchErrorToast('error_generic', e.status, e.message, false, e.showError, { | |
code: errorCode, | |
subCode: e.status, | |
desc: `Exception raised when uploading file(s): ${e.message}`, | |
}); |
🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'if' condition.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 375 to 379 in c008dbf
if (e.message === 'quotaexceeded') await this.actionBinder.dispatchErrorToast('upload_error_max_quota_exceeded', e.status, e.message, false, e.showError, { | |
code: errorCode, | |
subCode: 'upload_error_max_quota_exceeded', | |
desc: `Exception raised when uploading file(s): ${e.message}`, | |
}); |
🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'else'.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 380 to 384 in c008dbf
else await this.actionBinder.dispatchErrorToast('upload_error_no_storage_provision', e.status, e.message, false, e.showError, { | |
code: errorCode, | |
subCode: 'upload_error_no_storage_provision', | |
desc: `Exception raised when uploading file(s): ${e.message}`, | |
}); |
🚫 [eslint] <one-var> reported by reviewdog 🐶
Split 'let' declarations into multiple statements.
let blobData, assetData; |
🚫 [eslint] <one-var-declaration-per-line> reported by reviewdog 🐶
Expected variable declaration to be on a new line.
let blobData, assetData; |
🚫 [eslint] <one-var> reported by reviewdog 🐶
Split 'let' declarations into multiple statements.
let failedFiles, attemptMap; |
🚫 [eslint] <one-var-declaration-per-line> reported by reviewdog 🐶
Expected variable declaration to be on a new line.
let failedFiles, attemptMap; |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 446 to 447 in c008dbf
abortSignal | |
)); |
🚫 [eslint] <prefer-template> reported by reviewdog 🐶
Unexpected string concatenation.
desc: 'Error during chunk upload: ' + error.message, |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 133. Maximum allowed is 100.
const { blobDataArray, assetDataArray, fileTypeArray } = await this.createInitialAssets(files, workflowId, maxConcurrentFiles); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.
await this.actionBinder.dispatchErrorToast('pre_upload_error_create_asset', 500, 'Error during asset creation or blob retrieval', false, true, {code: 'pre_upload_error_create_asset'}); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
await this.actionBinder.dispatchErrorToast('pre_upload_error_create_asset', 500, 'Error during asset creation or blob retrieval', false, true, {code: 'pre_upload_error_create_asset'}); |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 101. Maximum allowed is 100.
this.transitionScreen.updateProgressBar(this.actionBinder.transitionScreen.splashScreenEl, 75); |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 111. Maximum allowed is 100.
const redirectSuccess = await this.handleFileUploadRedirect(assetDataArray[0].id, filesData, workflowId); |
🚫 [eslint] <one-var> reported by reviewdog 🐶
Split 'let' declarations into multiple statements.
let failedFiles, attemptMap; |
🚫 [eslint] <one-var-declaration-per-line> reported by reviewdog 🐶
Expected variable declaration to be on a new line.
let failedFiles, attemptMap; |
🚫 [eslint] <no-unused-vars> reported by reviewdog 🐶
'attemptMap' is assigned a value but never used.
({ failedFiles, attemptMap } = await this.chunkPdf( |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 143. Maximum allowed is 100.
const uploadedAssets = assetDataArray.filter((_, index) =>!(failedFiles && [...failedFiles].some(failed => failed.fileIndex === index))); |
🚫 [eslint] <arrow-spacing> reported by reviewdog 🐶
Missing space after =>.
const uploadedAssets = assetDataArray.filter((_, index) =>!(failedFiles && [...failedFiles].some(failed => failed.fileIndex === index))); |
🚫 [eslint] <arrow-parens> reported by reviewdog 🐶
Expected parentheses around arrow function argument.
const uploadedAssets = assetDataArray.filter((_, index) =>!(failedFiles && [...failedFiles].some(failed => failed.fileIndex === index))); |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 101. Maximum allowed is 100.
this.transitionScreen.updateProgressBar(this.actionBinder.transitionScreen.splashScreenEl, 95); |
🚫 [eslint] <quotes> reported by reviewdog 🐶
Strings must use singlequote.
await this.actionBinder.dispatchErrorToast('error_generic', error.code, `Exception in uploading one or more files`, true, true); |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-return-await> reported by reviewdog 🐶
Redundant use of await
on a return value.
return await this.actionBinder.handleRedirect(cOpts, filesData); |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-unused-vars> reported by reviewdog 🐶
'allVerified' is assigned a value but never used.
let allVerified = 0; |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 117. Maximum allowed is 100.
await this.executeInBatches(uploadedAssets, this.getConcurrentLimits().maxConcurrentFiles, async (assetData) => { |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 8 spaces but found 10.
const validated = await this.handleValidations(assetData, true); |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 8 spaces but found 10.
if (validated) allVerified += 1; |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 8 spaces but found 10.
else assetsToDelete.push(assetData); |
🚫 [eslint] <arrow-parens> reported by reviewdog 🐶
Expected parentheses around arrow function argument.
const verifiedAssets = uploadedAssets.filter(asset => |
🚫 [eslint] <implicit-arrow-linebreak> reported by reviewdog 🐶
Expected no linebreak before this expression.
!assetsToDelete.some(deletedAsset => deletedAsset.id === asset.id) |
🚫 [eslint] <arrow-parens> reported by reviewdog 🐶
Expected parentheses around arrow function argument.
!assetsToDelete.some(deletedAsset => deletedAsset.id === asset.id) |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 614 to 615 in c008dbf
!assetsToDelete.some(deletedAsset => deletedAsset.id === asset.id) | |
); |
🚫 [eslint] <function-paren-newline> reported by reviewdog 🐶
Unexpected newline before ')'.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 630 to 631 in c008dbf
subCode: error.code | |
}); |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <space-before-blocks> reported by reviewdog 🐶
Missing space before opening brace.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 651 to 656 in c008dbf
if (allNonPdf){ | |
const redirectSuccess = await this.actionBinder.handleRedirect(this.getGuestConnPayload('nonpdf'), filesData); | |
if (!redirectSuccess) return; | |
this.actionBinder.redirectWithoutUpload = true; | |
return; | |
} |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 128. Maximum allowed is 100.
if (this.actionBinder.workflowCfg.targetCfg.mfuUploadAllowed.includes(this.actionBinder.workflowCfg.enabledFeatures[0])) F438 { |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 137. Maximum allowed is 100.
if (this.actionBinder.workflowCfg.targetCfg.mfuUploadOnlyPdfAllowed.includes(this.actionBinder.workflowCfg.enabledFeatures[0])) { |
🚫 [eslint] <prefer-const> reported by reviewdog 🐶
'fileData' is never reassigned. Use 'const' instead.
let fileData = { type: 'mixed', size: filesData.size, count: pdfFiles.length, uploadType: 'mfu' }; |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
await this.uploadMultiFile(files, filesData); |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 101. Maximum allowed is 100.
this.transitionScreen.updateProgressBar(this.actionBinder.transitionScreen.splashScreenEl, 85); |
@@ -87,16 +87,22 @@ describe('Headers and Token', () => { | |||
}); | |||
}); | |||
|
|||
it('Should return headers with empty string if refresh token fails', async () => { | |||
it('Should return headers with empty string if refresh token fails', async function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected unnamed async function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
eslint
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_unsupported_type' found.
'validation_error_unsupported_type': 'verb_upload_error_unsupported_type', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_empty_file' found.
'validation_error_empty_file': 'verb_upload_error_empty_file', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_file_too_large' found.
'validation_error_file_too_large': 'verb_upload_error_file_too_large', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_only_accept_one_file' found.
'validation_error_only_accept_one_file': 'verb_upload_error_only_accept_one_file', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_file_same_type' found.
'validation_error_file_same_type': 'verb_upload_error_file_same_type', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_unsupported_type_multi' found.
'validation_error_unsupported_type_multi': 'verb_upload_error_unsupported_type_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_empty_file_multi' found.
'validation_error_empty_file_multi': 'verb_upload_error_empty_file_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_file_too_large_multi' found.
'validation_error_file_too_large_multi': 'verb_upload_error_file_too_large_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_multiple_invalid_files' found.
'validation_error_multiple_invalid_files': 'verb_upload_error_multiple_invalid_files', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_max_num_files' found.
'validation_error_max_num_files': 'verb_upload_error_max_num_files', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'validation_error_file_same_type_multi' found.
'validation_error_file_same_type_multi': 'verb_upload_error_file_same_type_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_max_page_count' found.
'upload_validation_error_max_page_count': 'verb_upload_error_max_page_count', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_min_page_count' found.
'upload_validation E552 _error_min_page_count': 'verb_upload_error_min_page_count', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_verify_page_count' found.
'upload_validation_error_verify_page_count': 'verb_upload_error_verify_page_count', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_max_page_count_multi' found.
'upload_validation_error_max_page_count_multi': 'verb_upload_error_max_page_count_multi', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_validation_error_duplicate_asset' found.
'upload_validation_error_duplicate_asset': 'verb_upload_error_duplicate_asset', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_max_quota_exceeded' found.
'upload_error_max_quota_exceeded': 'verb_upload_error_max_quota_exceeded', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_no_storage_provision' found.
'upload_error_no_storage_provision': 'verb_upload_error_no_storage_provision', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_chunk_upload' found.
'upload_error_chunk_upload': 'verb_upload_error_chunk_upload', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_finalize_asset' found.
'upload_error_finalize_asset': 'verb_upload_error_finalize_asset', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_error_redirect_to_app' found.
'upload_error_redirect_to_app': 'verb_upload_error_redirect_to_app', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'upload_warn_chunk_upload' found.
'upload_warn_chunk_upload': 'verb_upload_warn_chunk_upload', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'pre_upload_warn_renamed_invalid_file_name' found.
'pre_upload_warn_renamed_invalid_file_name': 'verb_warn_renamed_invalid_file_name', |
🚫 [eslint] <quote-props> reported by reviewdog 🐶
Unnecessarily quoted property 'warn_delete_asset' found.
'warn_delete_asset': 'verb_upload_warn_delete_asset', |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 345 to 346 in 92d6b8f
getMetadata: `${unityConfig.apiEndPoint}/asset/metadata` | |
}; |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 384 to 385 in 92d6b8f
desc: errorMetaData.desc || message || undefined | |
}, |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
There should be no space before ','.
const detail = { event: eventName, ...(data && { data }) , sendToSplunk }; |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
fileName = DOS_SPECIAL_NAMES.has(nameWithoutExtension.toUpperCase()) |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
? `---${ext}` |
🚫 [eslint] <semi> reported by reviewdog 🐶
Missing semicolon.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 426 to 427 in 92d6b8f
await this.dispatchErrorToast('pre_upload_warn_renamed_invalid_file_name', null, `Renamed ${rawFileName} to ${fileName}`, true) | |
} |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
return multiFileErrorMessage.endsWith('_multi') |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
? multiFileErrorMessage.slice(0, -6) |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
await this.dispatchErrorToast('validation_error_max_num_files', null, `Maximum ${this.limits.maxNumFiles} files allowed`, false, true, { |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
code: 'validation_error_validate_files', |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 466 to 467 in 92d6b8f
subCode: 'validation_error_max_num_files' | |
}); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
return { isValid: false, validFiles}; |
🚫 [eslint] <keyword-spacing> reported by reviewdog 🐶
Expected space(s) after "if".
if(!(cOpts.payload.feedback)) { |
🚫 [eslint] <quotes> reported by reviewdog 🐶
Strings must use singlequote.
if (this.multiFileValidationFailure) cOpts.payload.feedback = "uploaderror"; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.
this.dispatchAnalyticsEvent('redirectUrl', {...filesData, redirectUrl: this.redirectUrl}); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
this.dispatchAnalyticsEvent('redirectUrl', {...filesData, redirectUrl: this.redirectUrl}); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.
this.filesData = {...this.filesData,uploadType: 'sfu'}; |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.
this.filesData = {...this.filesData,uploadType: 'sfu'}; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
this.filesData = {...this.filesData,uploadType: 'sfu'}; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.
this.filesData = {...this.filesData,uploadType: 'mfu'}; |
🚫 [eslint] <comma-spacing> reported by reviewdog 🐶
A space is required after ','.
this.filesData = {...this.filesData,uploadType: 'mfu'}; |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
this.filesData = {...this.filesData,uploadType: 'mfu'}; |
🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'if' condition.
unity/unitylibs/core/workflow/workflow-acrobat/action-binder.js
Lines 628 to 631 in 92d6b8f
if (!combinedLimits || Object.keys(combinedLimits).length === 0) await this.dispatchErrorToast('error_generic', 500, 'No verb limits found', false, true, { | |
code: 'pre_upload_error_empty_verb_limits', | |
desc: 'No verb limits found', | |
}); |
🚫 [eslint] <eol-last> reported by reviewdog 🐶
Newline required at end of file but not found.
🚫 [eslint] <no-multiple-empty-lines> reported by reviewdog 🐶
More than 1 blank line not allowed.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 51 to 52 in 92d6b8f
async uploadFileToUnityWithRetry(url, blobData, fileType, assetId, signal, chunkNumber = 0) { |
🚫 [eslint] <no-plusplus> reported by reviewdog 🐶
Unary operator '++' used.
for (let attempt = 1; attempt <= maxRetries; attempt++) { |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 109. Maximum allowed is 100.
const response = await this.uploadFileToUnity(url, blobData, fileType, assetId, signal, chunkNumber); |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
} catch (err) { |
🚫 [eslint] <no-loop-func> reported by reviewdog 🐶
Function declared in a loop contains unsafe references to variable(s) 'retryDelay'.
await new Promise(resolve => setTimeout(resolve, retryDelay)); |
🚫 [eslint] <arrow-parens> reported by reviewdog 🐶
Expected parentheses around arrow function argument.
await new Promise(resolve => setTimeout(resolve, retryDelay)); |
🚫 [eslint] <no-promise-executor-return> reported by reviewdog 🐶
Return values from promise executor functions cannot be read.
await new Promise(resolve => setTimeout(resolve, retryDelay)); |
🚫 [eslint] <operator-assignment> reported by reviewdog 🐶
Assignment (=) can be replaced with operator assignment (+=).
if (error) error.message = error.message + ', Max retry delay exceeded during upload'; |
🚫 [eslint] <prefer-template> reported by reviewdog 🐶
Unexpected string concatenation.
if (error) error.message = error.message + ', Max retry delay exceeded during upload'; |
🚫 [eslint] <object-shorthand> reported by reviewdog 🐶
Expected property shorthand.
signal: signal |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 88 to 89 in 92d6b8f
signal: signal | |
}; |
🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'if' condition.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 112 to 116 in 92d6b8f
} else if (['Timeout'].includes(e.name)) await this.actionBinder.dispatchErrorToast('upload_warn_chunk_upload', 504, `Timeout when uploading chunk to storage; ${assetId}, ${blobData.size} bytes`, true, true, { | |
code: 'upload_warn_chunk_upload', | |
subCode: chunkNumber, | |
desc: `Timeout when uploading chunk to storage; ${assetId}, ${blobData.size} bytes; status: ${e.status}`, | |
}); else { |
🚫 [eslint] <consistent-return> reported by reviewdog 🐶
Expected to return a value at the end of async arrow function.
return async () => { |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 142. Maximum allowed is 100.
const { attempt } = await this.uploadFileToUnityWithRetry(url.href, chunk, fileType, assetData.id, signal, parseInt(chunkNumber)); |
🚫 [eslint] <radix> reported by reviewdog 🐶
Missing radix parameter.
const { attempt } = await this.uploadFileToUnityWithRetry(url.href, chunk, fileType, assetData.id, signal, parseInt(chunkNumber)); |
🚫 [eslint] <object-shorthand> reported by reviewdog 🐶
Expected property shorthand.
{ body: JSON.stringify(finalAssetData), signal: signal }, |
🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.
async checkPageNumCount(assetData, isMultiFile=false) { |
🚫 [eslint] <no-use-before-define> reported by reviewdog 🐶
'timeoutId' was used before it was defined.
clearTimeout(timeoutId); |
🚫 [eslint] <space-infix-ops> reported by reviewdog 🐶
Operator '=' must be spaced.
async handleUploadError(e, errorCode='error_generic') { |
🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'else'.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 368 to 372 in 92d6b8f
else await this.actionBinder.dispatchErrorToast('error_generic', e.status, e.message, false, e.showError, { | |
code: errorCode, | |
subCode: e.status, | |
desc: `Exception raised when uploading file(s): ${e.message}`, | |
}); |
🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'if' condition.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 375 to 379 in 92d6b8f
if (e.message === 'quotaexceeded') await this.actionBinder.dispatchErrorToast('upload_error_max_quota_exceeded', e.status, e.message, false, e.showError, { | |
code: errorCode, | |
subCode: 'upload_error_max_quota_exceeded', | |
desc: `Exception raised when uploading file(s): ${e.message}`, | |
}); |
🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'else'.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 380 to 384 in 92d6b8f
else await this.actionBinder.dispatchErrorToast('upload_error_no_storage_provision', e.status, e.message, false, e.showError, { | |
code: errorCode, | |
subCode: 'upload_error_no_storage_provision', | |
desc: `Exception raised when uploading file(s): ${e.message}`, | |
}); |
🚫 [eslint] <one-var> reported by reviewdog 🐶
Split 'let' declarations into multiple statements.
let blobData, assetData; |
🚫 [eslint] <one-var-declaration-per-line> reported by reviewdog 🐶
Expected variable declaration to be on a new line.
let blobData, assetData; |
🚫 [eslint] <one-var> reported by reviewdog 🐶
Split 'let' declarations into multiple statements.
let failedFiles, attemptMap; |
🚫 [eslint] <one-var-declaration-per-line> reported by reviewdog 🐶
Expected variable declaration to be on a new line.
let failedFiles, attemptMap; |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 446 to 447 in 92d6b8f
abortSignal | |
)); |
🚫 [eslint] <prefer-template> reported by reviewdog 🐶
Unexpected string concatenation.
desc: 'Error during chunk upload: ' + error.message, |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 133. Maximum allowed is 100.
const { blobDataArray, assetDataArray, fileTypeArray } = await this.createInitialAssets(files, workflowId, maxConcurrentFiles); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required after '{'.
await this.actionBinder.dispatchErrorToast('pre_upload_error_create_asset', 500, 'Error during asset creation or blob retrieval', false, true, {code: 'pre_upload_error_create_asset'}); |
🚫 [eslint] <object-curly-spacing> reported by reviewdog 🐶
A space is required before '}'.
await this.actionBinder.dispatchErrorToast('pre_upload_error_create_asset', 500, 'Error during asset creation or blob retrieval', false, true, {code: 'pre_upload_error_create_asset'}); |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 101. Maximum allowed is 100.
this.transitionScreen.updateProgressBar(this.actionBinder.transitionScreen.splashScreenEl, 75); |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 111. Maximum allowed is 100.
const redirectSuccess = await this.handleFileUploadRedirect(assetDataArray[0].id, filesData, workflowId); |
🚫 [eslint] <one-var> reported by reviewdog 🐶
Split 'let' declarations into multiple statements.
let failedFiles, attemptMap; |
🚫 [eslint] <one-var-declaration-per-line> reported by reviewdog 🐶
Expected variable declaration to be on a new line.
let failedFiles, attemptMap; |
🚫 [eslint] <no-unused-vars> reported by reviewdog 🐶
'attemptMap' is assigned a value but never used.
({ failedFiles, attemptMap } = await this.chunkPdf( |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 143. Maximum allowed is 100.
const uploadedAssets = assetDataArray.filter((_, index) =>!(failedFiles && [...failedFiles].some(failed => failed.fileIndex === index))); |
🚫 [eslint] <arrow-spacing> reported by reviewdog 🐶
Missing space after =>.
const uploadedAssets = assetDataArray.filter((_, index) =>!(failedFiles && [...failedFiles].some(failed => failed.fileIndex === index))); |
🚫 [eslint] <arrow-parens> reported by reviewdog 🐶
Expected parentheses around arrow function argument.
const uploadedAssets = assetDataArray.filter((_, index) =>!(failedFiles && [...failedFiles].some(failed => failed.fileIndex === index))); |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 101. Maximum allowed is 100.
this.transitionScreen.updateProgressBar(this.actionBinder.transitionScreen.splashScreenEl, 95); |
🚫 [eslint] <quotes> reported by reviewdog 🐶
Strings must use singlequote.
await this.actionBinder.dispatchErrorToast('error_generic', error.code, `Exception in uploading one or more files`, true, true); |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-return-await> reported by reviewdog 🐶
Redundant use of await
on a return value.
return await this.actionBinder.handleRedirect(cOpts, filesData); |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-unused-vars> reported by reviewdog 🐶
'allVerified' is assigned a value but never used.
let allVerified = 0; |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 117. Maximum allowed is 100.
await this.executeInBatches(uploadedAssets, this.getConcurrentLimits().maxConcurrentFiles, async (assetData) => { |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 8 spaces but found 10.
const validated = await this.handleValidations(assetData, true); |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 8 spaces but found 10.
if (validated) allVerified += 1; |
🚫 [eslint] <indent> reported by reviewdog 🐶
Expected indentation of 8 spaces but found 10.
else assetsToDelete.push(assetData); |
🚫 [eslint] <arrow-parens> reported by reviewdog 🐶
Expected parentheses around arrow function argument.
const verifiedAssets = uploadedAssets.filter(asset => |
🚫 [eslint] <implicit-arrow-linebreak> reported by reviewdog 🐶
Expected no linebreak before this expression.
!assetsToDelete.some(deletedAsset => deletedAsset.id === asset.id) |
🚫 [eslint] <arrow-parens> reported by reviewdog 🐶
Expected parentheses around arrow function argument.
!assetsToDelete.some(deletedAsset => deletedAsset.id === asset.id) |
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 614 to 615 in 92d6b8f
!assetsToDelete.some(deletedAsset => deletedAsset.id === asset.id) | |
); |
🚫 [eslint] <function-paren-newline> reported by reviewdog 🐶
Unexpected newline before ')'.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 630 to 631 in 92d6b8f
subCode: error.code | |
}); |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <space-before-blocks> reported by reviewdog 🐶
Missing space before opening brace.
unity/unitylibs/core/workflow/workflow-acrobat/upload-handler.js
Lines 651 to 656 in 92d6b8f
if (allNonPdf){ | |
const redirectSuccess = await this.actionBinder.handleRedirect(this.getGuestConnPayload('nonpdf'), filesData); | |
if (!redirectSuccess) return; | |
this.actionBinder.redirectWithoutUpload = true; | |
return; | |
} |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 128. Maximum allowed is 100.
if (this.actionBinder.workflowCfg.targetCfg.mfuUploadAllowed.includes(this.actionBinder.workflowCfg.enabledFeatures[0])) { |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 137. Maximum allowed is 100.
if (this.actionBinder.workflowCfg.targetCfg.mfuUploadOnlyPdfAllowed.includes(this.actionBinder.workflowCfg.enabledFeatures[0])) { |
🚫 [eslint] <prefer-const> reported by reviewdog 🐶
'fileData' is never reassigned. Use 'const' instead.
let fileData = { type: 'mixed', size: filesData.size, count: pdfFiles.length, uploadType: 'mfu' }; |
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
await this.uploadMultiFile(files, filesData); |
🚫 [eslint] <max-len> reported by reviewdog 🐶
This line has a length of 101. Maximum allowed is 100.
this.transitionScreen.updateProgressBar(this.actionBinder.transitionScreen.splashScreenEl, 85); |
@rohitsahu Please reference the following ticket in the PR title and description. |
describe('createActionBtn', () => { | ||
it('should create a button with text', async () => { | ||
const btnCfg = document.createElement('div'); | ||
btnCfg.innerText = 'Test Button'; | ||
const btn = await utils.createActionBtn(btnCfg, 'test-class'); | ||
expect(btn).to.be.instanceOf(HTMLElement); | ||
expect(btn.className).to.include('test-class'); | ||
expect(btn.textContent).to.include('Test Button'); | ||
}); | ||
it('should prepend text if swapOrder is true', async () => { | ||
const btnCfg = document.createElement('div'); | ||
btnCfg.innerText = 'Test Button'; | ||
const btn = await utils.createActionBtn(btnCfg, 'test-class', false, true); | ||
expect(btn.firstChild.className).to.include('btn-text'); | ||
}); | ||
}); | ||
|
||
describe('showErrorToast', () => { | ||
let fetchStub; | ||
let origImport; | ||
beforeEach(() => { | ||
fetchStub = sinon.stub(window, 'fetch'); | ||
fetchStub.onFirstCall().resolves({ text: () => Promise.resolve('<svg>alert</svg>') }); | ||
fetchStub.onSecondCall().resolves({ text: () => Promise.resolve('<svg>close</svg>') }); | ||
origImport = window.import; | ||
window.import = () => Promise.resolve({ decorateDefaultLinkAnalytics: sinon.stub() }); | ||
}); | ||
afterEach(() => { | ||
fetchStub.restore(); | ||
window.import = origImport; | ||
}); | ||
it('should append error toast if not present and set message', async () => { | ||
const targetEl = document.createElement('div'); | ||
const unityEl = document.createElement('div'); | ||
const msgEl = document.createElement('span'); | ||
msgEl.textContent = 'Error message'; | ||
unityEl.appendChild(document.createElement('div')); | ||
unityEl.appendChild(msgEl); | ||
unityEl.querySelector = () => unityEl.children[0]; | ||
document.body.innerHTML = '<div class="unity-enabled"><div class="interactive-area"><div class="alert-holder"><div class="alert-toast"><div class="alert-text"><p></p></div></div></div></div></div>'; | ||
await utils.showErrorToast(targetEl, unityEl, 'div'); | ||
const p = document.querySelector('.unity-enabled .interactive-area .alert-holder .alert-toast .alert-text p'); | ||
expect(p.innerText).to.equal('Error message'); | ||
const holder = document.querySelector('.unity-enabled .interactive-area .alert-holder'); | ||
expect(holder.style.display).to.equal('flex'); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just adding a note that these will most likely need to be removed later once these Ps-specific functions are removed from our utils file.
I see Nala tests are currently failing with this PR. Could you please look into this? |
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected unnamed function.
sinon.stub(UnityWidget.prototype, 'loadPrompts').callsFake(function () { |
const coverageFile = path.join(__dirname, '..', 'coverage', 'lcov.info'); | ||
|
||
if (!fs.existsSync(coverageFile)) { | ||
console.error('❌ Coverage file not found. Run tests with coverage first.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected console statement.
|
||
const coverage = parseLcovFile(coverageFile); | ||
|
||
console.log('📊 Coverage Report:'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected console statement.
const coverage = parseLcovFile(coverageFile); | ||
|
||
console.log('📊 Coverage Report:'); | ||
console.log(` Lines: ${coverage.lines.hit}/${coverage.lines.total} (${coverage.lines.percentage.toFixed(2)}%)`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected console statement.
|
||
console.log('📊 Coverage Report:'); | ||
console.log(` Lines: ${coverage.lines.hit}/${coverage.lines.total} (${coverage.lines.percentage.toFixed(2)}%)`); | ||
console.log(` Functions: ${coverage.functions.hit}/${coverage.functions.total} (${coverage.functions.percentage.toFixed(2)}%)`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected console statement.
console.log('📊 Coverage Report:'); | ||
console.log(` Lines: ${coverage.lines.hit}/${coverage.lines.total} (${coverage.lines.percentage.toFixed(2)}%)`); | ||
console.log(` Functions: ${coverage.functions.hit}/${coverage.functions.total} (${coverage.functions.percentage.toFixed(2)}%)`); | ||
console.log(` Branches: ${coverage.branches.hit}/${coverage.branches.total} (${coverage.branches.percentage.toFixed(2)}%)`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected console statement.
const overallCoverage = coverage.lines.percentage; | ||
|
||
if (overallCoverage >= COVERAGE_THRESHOLD) { | ||
console.log(`✅ Coverage ${overallCoverage.toFixed(2)}% meets the required ${COVERAGE_THRESHOLD}% threshold`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected console statement.
console.log(`✅ Coverage ${overallCoverage.toFixed(2)}% meets the required ${COVERAGE_THRESHOLD}% threshold`); | ||
process.exit(0); | ||
} else { | ||
console.log(`❌ Coverage ${overallCoverage.toFixed(2)}% is below the required ${COVERAGE_THRESHOLD}% threshold`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected console statement.
process.exit(0); | ||
} else { | ||
console.log(`❌ Coverage ${overallCoverage.toFixed(2)}% is below the required ${COVERAGE_THRESHOLD}% threshold`); | ||
console.log(` Need ${(COVERAGE_THRESHOLD - overallCoverage).toFixed(2)}% more coverage to pass`); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unexpected console statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
eslint
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <object-curly-newline> reported by reviewdog 🐶
Unexpected line break after this opening brace.
window.localStorage = { |
🚫 [eslint] <object-curly-newline> reported by reviewdog 🐶
Unexpected line break before this closing brace.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <object-curly-newline> reported by reviewdog 🐶
Unexpected line break after this opening brace.
const cOpts = { |
🚫 [eslint] <object-curly-newline> reported by reviewdog 🐶
Unexpected line break before this closing brace.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.
* stage: [MWPW-174041] : Generic method to parse the error object (including nested error object) and flatten it to be logged in splunk incase of ims token failure (#497) [MWPW-175541] Improve Unit Tests (#496) [MWPW-175937] Unity linting fixes (#495) [NALA]UI Automation tests scripts for batch 2A verbs (#491) [MWPW-174048] Remove close icon from prompt suggestion dropdown (#492) IMS error logging improvement - Phase 1 (#493) [MWPW-173462] Loading screen: Text should not be marked as a heading (#487) Allow empty query (#488) Sending error object in addition to error message in case of IMS token failures (#486) [MWPW-174632] Getting 'unable to process the request' error toast for 'Empty File + Max File Size' upload for 2b/2c (#476) [MWPW-171797] Introduce timeout to all fetch calls being made (#484) # Conflicts: # unitylibs/core/workflow/workflow-acrobat/action-binder.js # unitylibs/core/workflow/workflow-acrobat/upload-handler.js
* stage: [MWPW-173999] [MWPW-174144] Add additional headers (#457) [MWPW-174041] : Generic method to parse the error object (including nested error object) and flatten it to be logged in splunk incase of ims token failure (#497) [MWPW-175541] Improve Unit Tests (#496) [MWPW-175937] Unity linting fixes (#495) [NALA]UI Automation tests scripts for batch 2A verbs (#491) [MWPW-174048] Remove close icon from prompt suggestion dropdown (#492) IMS error logging improvement - Phase 1 (#493) # Conflicts: # unitylibs/core/workflow/workflow-acrobat/action-binder.js
* Overall Unit test coverage increased to 80% from 67% * Written unit tests for acrobat workflows and common code.
- #457 - #497 - #496 - #495 - #491 - #492 - #493 **Test URLs:** CC - Before: https://main--cc--adobecom.hlx.live/products/photoshop/online?unitylibs=main - After: https://main--cc--adobecom.hlx.live/products/photoshop/online?unitylibs=stage DC - Before: https://main--dc--adobecom.hlx.live/acrobat/online/compress?unitylibs=main - After: https://main--dc--adobecom.hlx.live/acrobat/online/compress?unitylibs=stage
Before:
Resolves: MWPW-175541
Test URLs: