Skip to content
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

#2289 - Implement logic for Application Event Code in IER12 - code and date assignment and unit tests (Part 4) #2420

Merged
merged 7 commits into from
Oct 18, 2023

Conversation

ann-aot
Copy link
Contributor

@ann-aot ann-aot commented Oct 16, 2023

Final PR for the story

  • Replaced appendOptionalStringWithFiller with appendStringWithFiller for both application event code and application event date.
  • Created below unit test,
    image
    image
    image
    image
    image

@ann-aot ann-aot marked this pull request as ready for review October 17, 2023 21:11
record.appendOptionalStringWithFiller(this.applicationEventCode, 4);
record.appendOptionalFormattedDate(this.applicationEventDate);
record.appendStringWithFiller(this.applicationEventCode, 4);
record.appendFormattedDate(this.applicationEventDate);
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

@guru-aot
Copy link
Collaborator

Done with the review, please have a look on the other dev comments

disbursementScheduleStatus: DisbursementScheduleStatus.Sent,
disbursementFeedbackErrors: [
{
errorCode: "XXXXX",
Copy link
Collaborator

Choose a reason for hiding this comment

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

👍

payload,
);
// Assert
expect(
Copy link
Collaborator

@dheepak-aot dheepak-aot Oct 18, 2023

Choose a reason for hiding this comment

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

To clarify, isn't our intention here to assert the final event code obtained (including the expect that we have now)? I know we don't have to cover all the scenarios which happens inside this method as they are covered in the unit tests for child methods.

Same in other places

Copy link
Collaborator

Choose a reason for hiding this comment

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

The unit tests should cover the scenarios for the method being tested. For this specific method, it should validate the switch logic mainly, and, as you mentioned, the other methods should be validated by the other unit tests.

Copy link
Contributor Author

@ann-aot ann-aot Oct 18, 2023

Choose a reason for hiding this comment

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

Initially, I had a similar qn and discussed it with @andrewsignori-aot , Here except for canceled. all other services are covered in the separate unit tests, So here the intention is to test the switch cases.

@dheepak-aot
Copy link
Collaborator

Nice work @ann-aot . Please have a look at the comments.

I totally missed something in the past PR about hasAwardWithheldDueToRestriction. We could have used the disbursement values returned from the getPendingAssessment query. I am not going to ask for any change but to record the point. Please let me know if I am missing something here.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Great work with the unit test. Please take a look at the minor comments.

Copy link
Collaborator

@andrewsignori-aot andrewsignori-aot left a comment

Choose a reason for hiding this comment

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

Thanks for making the changes and for taking care of the change suggested for hasAwardWithheldDueToRestriction. Looks good 👍
Thanks @dheepak-aot for the nice catch 😉

* @returns true if there is any partial or full award amount, that
* was withheld due to a restriction.
*/
private hasAwardWithheldDueToRestriction(
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for making this change 👍

Copy link
Collaborator

@dheepak-aot dheepak-aot left a comment

Choose a reason for hiding this comment

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

Great job! thanks for doing the withheld restriction logic change in last minute.

Copy link
Collaborator

@guru-aot guru-aot left a comment

Choose a reason for hiding this comment

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

LGTM, @ann-aot nice work

Copy link
Collaborator

@sh16011993 sh16011993 left a comment

Choose a reason for hiding this comment

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

Nice work @ann-aot 👍

expect(applicationEventDate).toBe(updatedAt);
});

it(`Should return payloadDisbursementSchedule.disbursementDate - DISBURSEMENT_FILE_GENERATION_ANTICIPATION_DAYS when application event code is ${ApplicationEventCode.DISR}.`, () => {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should DISBURSEMENT_FILE_GENERATION_ANTICIPATION_DAYS be evaluated here as the other vars or just a text like "disbursement file generation anticipation days"?

Copy link
Collaborator

@andrepestana-aot andrepestana-aot left a comment

Choose a reason for hiding this comment

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

Good job. Just left a minor comment.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@github-actions
Copy link

Backend Unit Tests Coverage Report

Totals Coverage
Statements: 18.18% ( 2341 / 12875 )
Methods: 9.28% ( 151 / 1628 )
Lines: 20.7% ( 2016 / 9738 )
Branches: 11.53% ( 174 / 1509 )

@github-actions
Copy link

E2E Queue Consumers Coverage Report

Totals Coverage
Statements: 75.72% ( 555 / 733 )
Methods: 69.32% ( 61 / 88 )
Lines: 77.64% ( 486 / 626 )
Branches: 42.11% ( 8 / 19 )

@github-actions
Copy link

E2E Workflow Workers Coverage Report

Totals Coverage
Statements: 52.62% ( 341 / 648 )
Methods: 50% ( 40 / 80 )
Lines: 56.85% ( 282 / 496 )
Branches: 26.39% ( 19 / 72 )

@github-actions
Copy link

E2E SIMS API Coverage Report

Totals Coverage
Statements: 55.18% ( 4057 / 7352 )
Methods: 52.25% ( 499 / 955 )
Lines: 59.95% ( 3293 / 5493 )
Branches: 29.31% ( 265 / 904 )

@ann-aot ann-aot merged commit bb71d47 into main Oct 18, 2023
@ann-aot ann-aot temporarily deployed to DEV October 18, 2023 22:04 — with GitHub Actions Inactive
@ann-aot ann-aot temporarily deployed to DEV October 18, 2023 22:06 — with GitHub Actions Inactive
@ann-aot ann-aot temporarily deployed to DEV October 18, 2023 22:06 — with GitHub Actions Inactive
@ann-aot ann-aot temporarily deployed to DEV October 18, 2023 22:06 — with GitHub Actions Inactive
@ann-aot ann-aot temporarily deployed to DEV October 18, 2023 22:06 — with GitHub Actions Inactive
@ann-aot ann-aot temporarily deployed to DEV October 18, 2023 22:14 — with GitHub Actions Inactive
@ann-aot ann-aot temporarily deployed to DEV October 18, 2023 22:14 — with GitHub Actions Inactive
@ann-aot ann-aot deleted the feature/sims-#2289-part-4 branch October 19, 2023 00:06
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.

6 participants