8000 [MWPW-175541] Improve Unit Tests by rohitsahu · Pull Request #496 · adobecom/unity · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

[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

Merged
merged 31 commits into from
Jul 9, 2025
Merged

[MWPW-175541] Improve Unit Tests #496

merged 31 commits into from
Jul 9, 2025

Conversation

rohitsahu
Copy link
Collaborator
@rohitsahu rohitsahu commented Jul 3, 2025
  • Overall Unit test coverage increased to 80% from 67%
  • Written unit tests for acrobat workflows and common code.
    Before:
Screenshot 2025-07-07 at 11 27 01 AM After: Screenshot 2025-07-07 at 11 26 45 AM

Resolves: MWPW-175541

Test URLs:

Copy link
aem-code-sync bot commented Jul 3, 2025

Hello, I'm the AEM Code Sync Bot and I will run some actions to deploy your branch and validate page speed.
In case there are problems, just click a checkbox below to rerun the respective action.

  • Re-run PSI checks
  • Re-sync branch
Commits

@rohitsahu rohitsahu added enhancement New feature or request acrobat labels Jul 3, 2025
* 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
@aem-code-sync aem-code-sync bot temporarily deployed to ut-upload-handler July 7, 2025 07:04 Inactive
Copy link
@github-actions github-actions bot left a 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.

'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.

getMetadata: `${unityConfig.apiEndPoint}/asset/metadata`
};


🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.

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.


🚫 [eslint] <semi> reported by reviewdog 🐶
Missing semicolon.

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.

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.

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.

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.


🚫 [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.


🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.


🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'if' condition.

} 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.


🚫 [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.


🚫 [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'.

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.

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'.

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.


🚫 [eslint] <one-var-declaration-per-line> reported by reviewdog 🐶
Expected variable declaration to be on a new line.


🚫 [eslint] <one-var> reported by reviewdog 🐶
Split 'let' declarations into multiple statements.


🚫 [eslint] <one-var-declaration-per-line> reported by reviewdog 🐶
Expected variable declaration to be on a new line.


🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.


🚫 [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.


🚫 [eslint] <one-var-declaration-per-line> reported by reviewdog 🐶
Expected variable declaration to be on a new line.


🚫 [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.


🚫 [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.

!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.


🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.


🚫 [eslint] <space-before-blocks> reported by reviewdog 🐶
Missing space before opening brace.

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 () {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <func-names> reported by reviewdog 🐶
Unexpected unnamed async function.

@aem-code-sync aem-code-sync bot temporarily deployed to ut-upload-handler July 7, 2025 13:29 Inactive
Copy link
@github-actions github-actions bot left a 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.

getMetadata: `${unityConfig.apiEndPoint}/asset/metadata`
};


🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.

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.


🚫 [eslint] <semi> reported by reviewdog 🐶
Missing semicolon.

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.

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.

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.

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.


🚫 [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.


🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.


🚫 [eslint] <curly> reported by reviewdog 🐶
Expected { after 'if' condition.

} 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.


🚫 [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.


🚫 [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'.

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.

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'.

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.


🚫 [eslint] <one-var-declaration-per-line> reported by reviewdog 🐶
Expected variable declaration to be on a new line.


🚫 [eslint] <one-var> reported by reviewdog 🐶
Split 'let' declarations into multiple statements.


🚫 [eslint] <one-var-declaration-per-line> reported by reviewdog 🐶
Expected variable declaration to be on a new line.


🚫 [eslint] <comma-dangle> reported by reviewdog 🐶
Missing trailing comma.


🚫 [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.


🚫 [eslint] <one-var-declaration-per-line> reported by reviewdog 🐶
Expected variable declaration to be on a new line.


🚫 [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.


🚫 [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.

!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.


🚫 [eslint] <no-trailing-spaces> reported by reviewdog 🐶
Trailing spaces not allowed.


🚫 [eslint] <space-before-blocks> reported by reviewdog 🐶
Missing space before opening brace.

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);

@sanjayms01
Copy link
Collaborator

@rohitsahu Please reference the following ticket in the PR title and description.
https://jira.corp.adobe.com/browse/MWPW-175541

@sanjayms01 sanjayms01 requested a review from rgclayton July 8, 2025 05:12
Comment on lines +150 to +196
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');
});
});
Copy link
Collaborator

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.

@sanjayms01
Copy link
Collaborator

I see Nala tests are currently failing with this PR. Could you please look into this?
cc @skumar09

@rohitsahu
Copy link
Collaborator Author

I see Nala tests are currently failing with this PR. Could you please look into this? cc @skumar09

@skumar09 Can you please check the Nala tests? The failures does not seem to be related to the PR changes.
There are few timeout errors as well.

@rohitsahu
Copy link
Collaborator Author

@rohitsahu Please reference the following ticket in the PR title and description. https://jira.corp.adobe.com/browse/MWPW-175541

Done

@skumar09 skumar09 self-requested a review July 9, 2025 04:47
@aem-code-sync aem-code-sync bot temporarily deployed to ut-upload-handler July 9, 2025 05:32 Inactive
@aem-code-sync aem-code-sync bot temporarily deployed to ut-upload-handler July 9, 2025 05:47 Inactive
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <func-names> reported by reviewdog 🐶
Unexpected unnamed function.

sinon.stub(UnityWidget.prototype, 'loadPrompts').callsFake(function () {

@aem-code-sync aem-code-sync bot temporarily deployed to ut-upload-handler July 9, 2025 05:58 Inactive
const coverageFile = path.join(__dirname, '..', 'coverage', 'lcov.info');

if (!fs.existsSync(coverageFile)) {
console.error('❌ Coverage file not found. Run tests with coverage first.');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <no-console> reported by reviewdog 🐶
Unexpected console statement.


const coverage = parseLcovFile(coverageFile);

console.log('📊 Coverage Report:');
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <no-console> reported by reviewdog 🐶
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)}%)`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <no-console> reported by reviewdog 🐶
Unexpected console statement.

57AE

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)}%)`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <no-console> reported by reviewdog 🐶
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)}%)`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <no-console> reported by reviewdog 🐶
Unexpected console statement.

const overallCoverage = coverage.lines.percentage;

if (overallCoverage >= COVERAGE_THRESHOLD) {
console.log(`✅ Coverage ${overallCoverage.toFixed(2)}% meets the required ${COVERAGE_THRESHOLD}% threshold`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <no-console> reported by reviewdog 🐶
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`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <no-console> reported by reviewdog 🐶
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`);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ [eslint] <no-console> reported by reviewdog 🐶
Unexpected console statement.

@aem-code-sync aem-code-sync bot temporarily deployed to ut-upload-handler July 9, 2025 06:30 Inactive
Copy link
@github-actions github-actions bot left a 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.


🚫 [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.


🚫 [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.

@aem-code-sync aem-code-sync bot temporarily deployed to ut-upload-handler July 9, 2025 06:49 Inactive
@rohitsahu rohitsahu merged commit 8e5b264 into stage Jul 9, 2025
4 of 6 checks passed
rohitsahu pushed a commit that referenced this pull request Jul 10, 2025
* 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
rohitsahu pushed a commit that referenced this pull request Jul 10, 2025
* 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
sanjayms01 pushed a commit that referenced this pull request Jul 10, 2025
* Overall Unit test coverage increased to 80% from 67%
* Written unit tests for acrobat workflows and common code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0