Skip to content

Commit

Permalink
#3375 - Add current year income question (income appeal) (#3733)
Browse files Browse the repository at this point in the history
  • Loading branch information
guru-aot and guru-aot authored Sep 24, 2024
1 parent 89d4bde commit 35d826a
Show file tree
Hide file tree
Showing 10 changed files with 5,434 additions and 3,576 deletions.
45 changes: 45 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,51 @@
"ENVIRONMENT": "test",
"TZ": "UTC"
}
},
{
"type": "node",
"request": "launch",
"name": "Workflow - Current test file",
"program": "${workspaceFolder}/sources/packages/backend/node_modules/.bin/jest",
"args": [
"${fileBasenameNoExtension}",
"--runInBand",
"--config",
"./sources/packages/backend/workflow/test/jest-e2e.json",
"--forceExit"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/sources/packages/backend/node_modules/jest/bin/jest"
},
"env": {
"ENVIRONMENT": "test",
"TZ": "UTC"
}
},
{
"type": "node",
"request": "launch",
"name": "Workflow - all tests",
"program": "${workspaceFolder}/sources/packages/backend/node_modules/.bin/jest",
"args": [
"--runInBand",
"--config",
"./sources/packages/backend/workflow/test/jest-e2e.json",
"--forceExit"
],
"console": "integratedTerminal",
"internalConsoleOptions": "neverOpen",
"disableOptimisticBPs": true,
"windows": {
"program": "${workspaceFolder}/sources/packages/backend/node_modules/jest/bin/jest"
},
"env": {
"ENVIRONMENT": "test",
"TZ": "UTC"
}
}
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,7 @@
<zeebe:output source="=null" target="parent2TotalIncome" />
<zeebe:output source="=null" target="partner1TotalIncome" />
<zeebe:output source="=null" target="studentDataTaxReturnIncome" />
<zeebe:output source="=null" target="studentDataCurrentYearIncome" />
<zeebe:output source="=[]" target="parentSubprocesses" />
</zeebe:ioMapping>
</bpmn:extensionElements>
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,101 @@ describe(`E2E Test Workflow parttime-assessment-${PROGRAM_YEAR}-student-financia
},
);

it(
"Should have calculated student total income from the current year income and not from the the application data or the tax return income " +
"when there is a request a change for student financial information with current year income values.",
async () => {
// Arrange
const assessmentConsolidatedData =
createFakeConsolidatedPartTimeData(PROGRAM_YEAR);
assessmentConsolidatedData.studentDataHasDependents = YesNoOptions.No;
assessmentConsolidatedData.appealsStudentFinancialInformationAppealData =
{
taxReturnIncome: 1234,
currentYearIncome: 500,
};

// Act
const calculatedAssessment =
await executePartTimeAssessmentForProgramYear(
PROGRAM_YEAR,
assessmentConsolidatedData,
);

// Assert
expect(
calculatedAssessment.variables.calculatedDataCurrentYearIncome,
).toBe(500);
expect(
calculatedAssessment.variables.calculatedDataTotalFamilyIncome,
).toBe(500);
expect(
calculatedAssessment.variables.calculatedDataStudentTotalIncome,
).toBe(500);
},
);

it(
"Should have calculated student total income from the tax return income and not from the the application data tax return income " +
"when there is a request a change for student financial information with tax return income values.",
async () => {
// Arrange
const assessmentConsolidatedData =
createFakeConsolidatedPartTimeData(PROGRAM_YEAR);
assessmentConsolidatedData.studentDataCRAReportedIncome = null;
assessmentConsolidatedData.studentDataHasDependents = YesNoOptions.No;
assessmentConsolidatedData.appealsStudentFinancialInformationAppealData =
{
taxReturnIncome: 1234,
};

// Act
const calculatedAssessment =
await executePartTimeAssessmentForProgramYear(
PROGRAM_YEAR,
assessmentConsolidatedData,
);

// Assert
// Application data tax return income submitted by the student.
expect(assessmentConsolidatedData.studentDataTaxReturnIncome).toBe(40001);
expect(
calculatedAssessment.variables.calculatedDataTotalFamilyIncome,
).toBe(1234);
expect(
calculatedAssessment.variables.calculatedDataStudentTotalIncome,
).toBe(1234);
},
);

it(
"Should have calculated student total income from the CRA income " +
"when there is an appeal but the current year's income is not provided.",
async () => {
// Arrange
const assessmentConsolidatedData =
createFakeConsolidatedPartTimeData(PROGRAM_YEAR);
assessmentConsolidatedData.studentDataCRAReportedIncome = 999;
assessmentConsolidatedData.studentDataHasDependents = YesNoOptions.No;
assessmentConsolidatedData.appealsStudentFinancialInformationAppealData =
{
taxReturnIncome: 1234,
};

// Act
const calculatedAssessment =
await executePartTimeAssessmentForProgramYear(
PROGRAM_YEAR,
assessmentConsolidatedData,
);

// Assert
expect(
calculatedAssessment.variables.calculatedDataStudentTotalIncome,
).toBe(999);
},
);

afterAll(async () => {
// Closes the singleton instance created during test executions.
await ZeebeMockedClient.getMockedZeebeInstance().close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,114 @@ describe(`E2E Test Workflow parttime-assessment-${PROGRAM_YEAR}-student-financia
},
);

it(
"Should have calculated student total income from the current year income and not from the the application data or the tax return income " +
"when there is a request a change for student financial information with current year income values.",
async () => {
// Arrange
const assessmentConsolidatedData =
createFakeConsolidatedPartTimeData(PROGRAM_YEAR);
assessmentConsolidatedData.studentDataHasDependents = YesNoOptions.Yes;
assessmentConsolidatedData.studentDataDependants = [
createFakeStudentDependentEligibleForChildcareCost(
DependentChildCareEligibility.Eligible0To11YearsOld,
assessmentConsolidatedData.offeringStudyStartDate,
),
createFakeStudentDependentEligibleForChildcareCost(
DependentChildCareEligibility.Eligible12YearsAndOver,
assessmentConsolidatedData.offeringStudyStartDate,
),
];
assessmentConsolidatedData.appealsStudentFinancialInformationAppealData =
{
taxReturnIncome: 1234,
currentYearIncome: 500,
};

// Act
const calculatedAssessment =
await executePartTimeAssessmentForProgramYear(
PROGRAM_YEAR,
assessmentConsolidatedData,
);

// Assert
expect(
calculatedAssessment.variables.calculatedDataCurrentYearIncome,
).toBe(500);
expect(
calculatedAssessment.variables.calculatedDataTotalFamilyIncome,
).toBe(500);
expect(
calculatedAssessment.variables.calculatedDataStudentTotalIncome,
).toBe(500);
expect(
calculatedAssessment.variables.calculatedDataStudentTotalIncome,
).not.toBe(1234);
},
);

it(
"Should have calculated student total income from the tax return income and not from the the application data tax return income " +
"when there is a request a change for student financial information with tax return income values.",
async () => {
// Arrange
const assessmentConsolidatedData =
createFakeConsolidatedPartTimeData(PROGRAM_YEAR);
assessmentConsolidatedData.studentDataCRAReportedIncome = null;
assessmentConsolidatedData.studentDataHasDependents = YesNoOptions.No;
assessmentConsolidatedData.appealsStudentFinancialInformationAppealData =
{
taxReturnIncome: 1234,
};

// Act
const calculatedAssessment =
await executePartTimeAssessmentForProgramYear(
PROGRAM_YEAR,
assessmentConsolidatedData,
);

// Assert
// Application data tax return income submitted by the student.
expect(assessmentConsolidatedData.studentDataTaxReturnIncome).toBe(40001);
expect(
calculatedAssessment.variables.calculatedDataTotalFamilyIncome,
).toBe(1234);
expect(
calculatedAssessment.variables.calculatedDataStudentTotalIncome,
).toBe(1234);
},
);

it(
"Should have calculated student total income from the CRA income " +
"when there is an appeal but the current year's income is not provided.",
async () => {
// Arrange
const assessmentConsolidatedData =
createFakeConsolidatedPartTimeData(PROGRAM_YEAR);
assessmentConsolidatedData.studentDataCRAReportedIncome = 999;
assessmentConsolidatedData.studentDataHasDependents = YesNoOptions.No;
assessmentConsolidatedData.appealsStudentFinancialInformationAppealData =
{
taxReturnIncome: 1234,
};

// Act
const calculatedAssessment =
await executePartTimeAssessmentForProgramYear(
PROGRAM_YEAR,
assessmentConsolidatedData,
);

// Assert
expect(
calculatedAssessment.variables.calculatedDataStudentTotalIncome,
).toBe(999);
},
);

afterAll(async () => {
// Closes the singleton instance created during test executions.
await ZeebeMockedClient.getMockedZeebeInstance().close();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,114 @@ describe(`E2E Test Workflow parttime-assessment-${PROGRAM_YEAR}-student-financia
},
);

it(
"Should have calculated student total income from the current year income and not from the the application data or the tax return income " +
"when there is a request a change for student financial information with current year income values.",
async () => {
// Arrange
const assessmentConsolidatedData =
createFakeConsolidatedPartTimeData(PROGRAM_YEAR);
assessmentConsolidatedData.studentDataHasDependents = YesNoOptions.Yes;
assessmentConsolidatedData.studentDataDependants = [
createFakeStudentDependentEligibleForChildcareCost(
DependentChildCareEligibility.Eligible0To11YearsOld,
assessmentConsolidatedData.offeringStudyStartDate,
),
createFakeStudentDependentEligibleForChildcareCost(
DependentChildCareEligibility.Eligible12YearsAndOver,
assessmentConsolidatedData.offeringStudyStartDate,
),
];
assessmentConsolidatedData.appealsStudentFinancialInformationAppealData =
{
taxReturnIncome: 1234,
currentYearIncome: 500,
};

// Act
const calculatedAssessment =
await executePartTimeAssessmentForProgramYear(
PROGRAM_YEAR,
assessmentConsolidatedData,
);

// Assert
expect(
calculatedAssessment.variables.calculatedDataCurrentYearIncome,
).toBe(500);
expect(
calculatedAssessment.variables.calculatedDataTotalFamilyIncome,
).toBe(500);
expect(
calculatedAssessment.variables.calculatedDataStudentTotalIncome,
).toBe(500);
expect(
calculatedAssessment.variables.calculatedDataStudentTotalIncome,
).not.toBe(1234);
},
);

it(
"Should have calculated student total income from the tax return income and not from the the application data tax return income " +
"when there is a request a change for student financial information with tax return income values.",
async () => {
// Arrange
const assessmentConsolidatedData =
createFakeConsolidatedPartTimeData(PROGRAM_YEAR);
assessmentConsolidatedData.studentDataCRAReportedIncome = null;
assessmentConsolidatedData.studentDataHasDependents = YesNoOptions.No;
assessmentConsolidatedData.appealsStudentFinancialInformationAppealData =
{
taxReturnIncome: 1234,
};

// Act
const calculatedAssessment =
await executePartTimeAssessmentForProgramYear(
PROGRAM_YEAR,
assessmentConsolidatedData,
);

// Assert
// Application data tax return income submitted by the student.
expect(assessmentConsolidatedData.studentDataTaxReturnIncome).toBe(40001);
expect(
calculatedAssessment.variables.calculatedDataTotalFamilyIncome,
).toBe(1234);
expect(
calculatedAssessment.variables.calculatedDataStudentTotalIncome,
).toBe(1234);
},
);

it(
"Should have calculated student total income from the CRA income " +
"when there is an appeal but the current year's income is not provided.",
async () => {
// Arrange
const assessmentConsolidatedData =
createFakeConsolidatedPartTimeData(PROGRAM_YEAR);
assessmentConsolidatedData.studentDataCRAReportedIncome = 999;
assessmentConsolidatedData.studentDataHasDependents = YesNoOptions.No;
assessmentConsolidatedData.appealsStudentFinancialInformationAppealData =
{
taxReturnIncome: 1234,
};

// Act
const calculatedAssessment =
await executePartTimeAssessmentForProgramYear(
PROGRAM_YEAR,
assessmentConsolidatedData,
);

// Assert
expect(
calculatedAssessment.variables.calculatedDataStudentTotalIncome,
).toBe(999);
},
);

afterAll(async () => {
// Closes the singleton instance created during test executions.
await ZeebeMockedClient.getMockedZeebeInstance().close();
Expand Down
Loading

0 comments on commit 35d826a

Please sign in to comment.