This commit is contained in:
Zeeshaun
2026-05-06 15:08:32 +00:00
parent b05a1a954b
commit 0de593c7d3
54 changed files with 4522 additions and 0 deletions
@@ -374,6 +374,29 @@ describe('CreditApplicationService', () => {
});
it('should clear stale co-applicant spouse state when switching back to a single applicant', () => {
const marriedPrimaryApplication: any = JSON.parse(JSON.stringify(primaryAndCoApplicationAddressSameApplication));
spyOn(creditApplicationService, 'getFullCreditApplication').and.returnValue(marriedPrimaryApplication);
spyOn(creditApplicationService, 'saveCreditApplication').and.returnValue(of(true));
const memberInfo: MembershipInformation = {
limitRequested: marriedPrimaryApplication.limitRequested,
applicantType: CreditApplicationValues.CHOICE_NO,
livesInMaritalPropertyState: CreditApplicationValues.CHOICE_YES,
confirmJointCredit: null,
coApplicantLivesInMaritalPropertyState: null,
purposeOfLoanSignature: null,
agreementRequirement: undefined
};
creditApplicationService.saveMemberInformation(memberInfo);
expect(creditApplicationService.getFullCreditApplication().fullInfoBorrowers.length).toBe(1);
expect(creditApplicationService.getFullCreditApplication().hasCoApplicantSpouse).toBeNull();
expect(creditApplicationService.getFullCreditApplication().coApplicantLivesInMaritalPropertyState).toBeNull();
expect(creditApplicationService.getFullCreditApplication().confirmJointCredit).toBeNull();
});
it('should set Estimated Value & Property Type defaults on HELOC Rate Mod loan type', () => {
const loanConfigurationService = TestBed.get(ConfigurationService);
loanConfigurationService.saveConfiguration(DefaultSettings as UiSettings);
@@ -368,6 +368,9 @@ export class CreditApplicationService {
if (creditApplication.hasCoApplicant === CreditApplicationValues.CHOICE_NO &&
creditApplication.fullInfoBorrowers.length > 1) {
creditApplication.fullInfoBorrowers.pop();
creditApplication.hasCoApplicantSpouse = null;
creditApplication.coApplicantLivesInMaritalPropertyState = null;
creditApplication.confirmJointCredit = null;
}
if (memberInfo.applicantType === CreditApplicationValues.CHOICE_YES &&
memberInfo.coApplicantLivesInMaritalPropertyState === CreditApplicationValues.CHOICE_YES) {