Updating
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user