-
Notifications
You must be signed in to change notification settings - Fork 332
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
test(calling): voicemail module test cases added #3107
test(calling): voicemail module test cases added #3107
Conversation
9659ce3
to
28aef70
Compare
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.
Left few comments. please check.
packages/calling/src/Voicemail/BroadworksBackendConnector.test.ts
Outdated
Show resolved
Hide resolved
packages/calling/src/Voicemail/BroadworksBackendConnector.test.ts
Outdated
Show resolved
Hide resolved
28aef70
to
94f5e1f
Compare
94f5e1f
to
3e348f1
Compare
const mediaType = respHeaders?.mediatype as string; | ||
const mediaContent = contentInfo as string; | ||
const responseDetails = { | ||
statusCode: response.statusCode as number, | ||
statusCode: statusCode as number, |
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.
as number
is known to be problematic and we are changing it whenever we encounter it during new changes. Applicable across all files in the module. Please add this change.
statusCode: statusCode as number, | |
statusCode: Number(statusCode), |
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.
Done
@@ -465,7 +465,9 @@ export class BroadworksBackendConnector implements IBroadworksCallBackendConnect | |||
return responseDetails; | |||
} catch (err: unknown) { | |||
/* Catch the exception error code from try block, return the error object to user */ | |||
const errorInfo = err as WebexRequestPayload; | |||
const errorInfo = { | |||
statusCode: err instanceof Error ? Number(err.message) : '', |
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.
Can we not set '' as default statusCode. Put 422 or equivalent code. Applicable across the changes.
statusCode: err instanceof Error ? Number(err.message) : '', | |
statusCode: err instanceof Error ? Number(err.message) : 422, |
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.
We're setting default statusCode as 422 in serviceErrorCodeHandler
in the default switch statement when it doesn't matches with any of the status code. If we want to set it default here then we have to update it at multiple places wherever ' ' is passsed. Do you still suggest changing this at multiple places or current implementation is acceptable?
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.
Thats fine . Ignore this if it was like this
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.
Minor comments.
Can we try to increase branch coverage to minimum of 85% as well?
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.
Minor comments.
385fe20
to
8cf0559
Compare
@BhargavSatya I have made BroadworksBackendConnector file's branch coverage to >85%. For UcmBackendConnector file, we were not able to cover some part of code and those branches are part of those lines only so could not cover them as well. |
COMPLETES #< SPARK-422971 >
This pull request addresses
Code coverage for voicemail module files were less. Need to write UT to cover the uncovered code.
by making the following changes
Added UTs for following files:
Some code refactor in below files:
CODE COVERAGE REPORT:
PREVIOUSLY
CURRENT:
Change Type
The following scenarios where tested
< ENUMERATE TESTS PERFORMED, WHETHER MANUAL OR AUTOMATED >
I certified that
I have read and followed contributing guidelines
I discussed changes with code owners prior to submitting this pull request
I have not skipped any automated checks
All existing and new tests passed
I have updated the documentation accordingly
Make sure to have followed the contributing guidelines before submitting.