money: rent detection matches whole words ("living with parents" is not the rent)
Some checks failed
Deploy production / deploy (push) Failing after 1m6s
Some checks failed
Deploy production / deploy (push) Failing after 1m6s
The scenario move date came from the first Joint item matching /rent|huur/, which since the "Groceries (living with parents)" item matched that one, so the scenarios never moved out (no rent, the pre-move contribution forever).
This commit is contained in:
@@ -26,6 +26,13 @@ const inputs = scenarioInputs({
|
||||
{ name: 'Cargill salary', amountCents: 300000, cadence: 'monthly', accountId: 1 },
|
||||
{ name: 'Gym', amountCents: -3000, cadence: 'monthly', accountId: 1 },
|
||||
{ name: 'Benefit', amountCents: 10000, cadence: 'monthly', accountId: 1, endsOn: '2026-12-31' },
|
||||
{
|
||||
name: 'Groceries (living with parents)',
|
||||
amountCents: -5000,
|
||||
cadence: 'monthly',
|
||||
accountId: 4,
|
||||
endsOn: '2026-12-31'
|
||||
},
|
||||
{
|
||||
name: 'Rent + utilities (estimate)',
|
||||
amountCents: -180000,
|
||||
@@ -51,7 +58,10 @@ describe('scenarioInputs', () => {
|
||||
expect(inputs.investedCents).toBe(50000);
|
||||
expect(inputs.netSalaryCents).toBe(300000);
|
||||
expect(inputs.personal.map((item) => item.name)).toEqual(['Gym', 'Benefit']);
|
||||
expect(inputs.household.map((item) => item.name)).toEqual(['Rent + utilities (estimate)']);
|
||||
expect(inputs.household.map((item) => item.name)).toEqual([
|
||||
'Groceries (living with parents)',
|
||||
'Rent + utilities (estimate)'
|
||||
]);
|
||||
expect(inputs.moveDate).toBe('2027-03-01');
|
||||
// Salary extras are modelled by the scenarios, other one-offs pass through.
|
||||
expect(inputs.oneOffs.map((item) => item.description)).toEqual(['Side job']);
|
||||
|
||||
Reference in New Issue
Block a user