-
Notifications
You must be signed in to change notification settings - Fork 14
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
#1683 - Completed application - E2E tests for application tracker #1832
#1683 - Completed application - E2E tests for application tracker #1832
Conversation
sources/packages/backend/apps/api/src/services/application/application.service.ts
Show resolved
Hide resolved
fakeOriginalAssessment, | ||
); | ||
savedApplication.currentAssessment = savedOriginalAssessment; | ||
savedApplication.applicationStatus = ApplicationStatus.Enrolment; |
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.
mm, we are already saving the status at line 95 right? then why this assignment
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.
I do not see a reason to. I will remove the last one.
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.
Removed.
|
||
it("Should get application details when application is in 'Completed' status.", async () => { | ||
// Arrange | ||
const application = await saveFakeApplicationDisbursements( |
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.
mm, instead of getting a fake disbursement application and changing the data in the test to make it completed, can't we create a fakecompletedAppliaction? is there any reason for it?
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.
When we need an application with disbursements we will need: createFakeApplication
, createFakeStudentAssessment
, createFakeDisbursementSchedule
, createFakeEducationProgramOffering
, createFakeUser
, createFakeStudent
, etc., and then have all of them saved properly. When this method was introduced in the past for COE (and now renamed/moved for disbursements), the idea was to concentrate all the complexity of calling the previously mentioned createFake
methods and coordinate the way that they must be saved.
Does it answer? If not maybe I am not getting the point and we can have a chat. Please let me know.
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.
I guess that the answer is the same from #1832 (comment)
sources/packages/backend/libs/test-utils/src/factories/student-scholastic-standing.ts
Show resolved
Hide resolved
const scholasticStanding = createFakeStudentScholasticStanding({ | ||
submittedBy: submittedByInstitutionUser, | ||
}); | ||
// 'Student did not complete program' is the only'scholastic standing that does not generate an assessment. |
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.
only scholastic
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.
Fixed.
firstDisbursement.coeStatus = COEStatus.completed; | ||
await disbursementScheduleRepo.save(firstDisbursement); | ||
// Create a scholastic standing and have it associated with the completed application. | ||
const scholasticStanding = createFakeStudentScholasticStanding({ |
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.
application
can be passed here itself right?
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.
Changed.
...trollers/application/_tests_/application.students.getCompletedApplicationDetails.e2e-spec.ts
Show resolved
Hide resolved
...trollers/application/_tests_/application.students.getCompletedApplicationDetails.e2e-spec.ts
Show resolved
Hide resolved
application.currentAssessment.disbursementSchedules; | ||
firstDisbursement.coeStatus = COEStatus.completed; | ||
await disbursementScheduleRepo.save(firstDisbursement); | ||
// Create approved student appeal |
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.
full stop
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.
I will add the period.
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.
Period added.
appealRequests: [approvedAppealRequest], | ||
}); | ||
approvedAppeal.submittedDate = addDays(-1); | ||
// Create declined student appeal from yesterday |
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.
full stop
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.
I will add the period.
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.
Period added.
...trollers/application/_tests_/application.students.getCompletedApplicationDetails.e2e-spec.ts
Show resolved
Hide resolved
...trollers/application/_tests_/application.students.getCompletedApplicationDetails.e2e-spec.ts
Show resolved
Hide resolved
sources/packages/web/src/components/students/applicationTracker/ApplicationProgressBar.vue
Show resolved
Hide resolved
@@ -31,7 +31,7 @@ export default defineComponent({ | |||
required: true, | |||
}, | |||
cancelledDate: { | |||
type: String, | |||
type: Date, |
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.
👍
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.
Good work @andrewsignori-aot . added some comments
@@ -1504,10 +1500,6 @@ export class ApplicationService extends RecordDataModelService<Application> { | |||
student: { | |||
id: options?.studentId, | |||
}, | |||
studentScholasticStandings: { |
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.
👍
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.
Great job! Left a minor comment.
* - `submittedBy` institution user submitting the scholastic standing change. | ||
* - `application` related student application. | ||
* - `studentAssessment` related assessment. | ||
* - `student` related student. |
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.
Please remove student comment.
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.
Removed.
endStatusType?: "success" | "warning" | "error"; | ||
endStatusIcon?: string; | ||
class StatusIconDetails { | ||
constructor(public statusType?: "success" | "warning" | "error") {} |
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.
I see that having the statusType as optional is replicating the pattern of the interface, but I somehow feel like statusType
doesn't need to be optional as it would never be expected to be initialized without passing statusType
.
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.
This code was refactored, please take a look at the lastest PR updates.
endStatusType: "error", | ||
endStatusIcon: "fa:fas fa-exclamation-circle", | ||
}; | ||
statusIconDetails.value = new StatusIconDetails("success"); |
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.
I like this way of getting status icon details by associating the dependency between variables. We could start following this patten in such scenarios IMO. 👍
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.
Yes, I thought the same, but after our last Team conversation I thought that it would potentially cause more questions than benefits and that is why I did a refactor here. Please let me know if it is still ok.
endStatusType: "error", | ||
endStatusIcon: "fa:fas fa-exclamation-circle", | ||
}; | ||
statusIconDetails.value = STATUS_ICON_SUCCESS; |
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 can use the same class concept here and avoid using 3 interfaces.
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.
This is the refactoring of the previous class
. There is only one interface, I am not following what would be "avoid using 3 interfaces.".
Good work @andrewsignori-aot . Thanks for additional refactors. Just one minor comment. |
Kudos, SonarCloud Quality Gate passed!
|
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.
LGTM. 👍
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.
Good work @andrewsignori-aot 👍 Thanks for doing the changes
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.
LGTM, nice work @andrewsignori-aot
) - Fix for PIR decline throwing an error while completing the process. - Refactor application progress details to get rid of the Sonarcloud issue. - Icon spacing adjusted (@hellolynn-tbtb is aware of and approved it). - Renamed factory method saveFakeApplicationCOE to saveFakeApplicationDisbursements allowing it to be used for these E2E tests also. - Removed prefix ${ClientTypeBaseRoute.Institution} from some E2E that were wrongly added. - E2E tests for the new endpoint added for the completed status. ApplicationStudentsController(e2e)-getCompletedApplicationDetails ✓ Should throw NotFoundException when the application is not associated with the authenticated student. (390 ms) ✓ Should throw NotFoundException when the application is not in 'Completed' status. (75 ms) ✓ Should get application details when application is in 'Completed' status. (76 ms) ✓ Should get application details with scholastic standing change type when application has a scholastic standing 'Student did not complete program associated with. (60 ms) ✓ Should get application details with the most updated appeal status when the application has more than one student appeals associated with. (78 ms)
) - Fix for PIR decline throwing an error while completing the process. - Refactor application progress details to get rid of the Sonarcloud issue. - Icon spacing adjusted (@hellolynn-tbtb is aware of and approved it). - Renamed factory method saveFakeApplicationCOE to saveFakeApplicationDisbursements allowing it to be used for these E2E tests also. - Removed prefix ${ClientTypeBaseRoute.Institution} from some E2E that were wrongly added. - E2E tests for the new endpoint added for the completed status. ApplicationStudentsController(e2e)-getCompletedApplicationDetails ✓ Should throw NotFoundException when the application is not associated with the authenticated student. (390 ms) ✓ Should throw NotFoundException when the application is not in 'Completed' status. (75 ms) ✓ Should get application details when application is in 'Completed' status. (76 ms) ✓ Should get application details with scholastic standing change type when application has a scholastic standing 'Student did not complete program associated with. (60 ms) ✓ Should get application details with the most updated appeal status when the application has more than one student appeals associated with. (78 ms)
${ClientTypeBaseRoute.Institution}
from some E2E that were wrongly added.ApplicationStudentsController(e2e)-getCompletedApplicationDetails
✓ Should throw NotFoundException when the application is not associated with the authenticated student. (390 ms)
✓ Should throw NotFoundException when the application is not in 'Completed' status. (75 ms)
✓ Should get application details when application is in 'Completed' status. (76 ms)
✓ Should get application details with scholastic standing change type when application has a scholastic standing 'Student did not complete program associated with. (60 ms)
✓ Should get application details with the most updated appeal status when the application has more than one student appeals associated with. (78 ms)