-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
for ForecastParameters file
- Loading branch information
Showing
1 changed file
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { createForecastParameters, DEFAULT_FORECAST_PARAMETERS } from "./ForecastParameters"; | ||
|
||
it("can create default forecast parameters", () => { | ||
const params = createForecastParameters(DEFAULT_FORECAST_PARAMETERS.maintenancePercentage); | ||
expect(params).toBeDefined(); | ||
}); | ||
|
||
it("correctly sets maintenance percentage while keeping defaults", () => { | ||
const customMaintenance = 0.015; | ||
const params = createForecastParameters(customMaintenance); | ||
|
||
expect(params.maintenancePercentage).toBe(customMaintenance); | ||
expect(params.incomeGrowthPerYear).toBe(DEFAULT_FORECAST_PARAMETERS.incomeGrowthPerYear); | ||
expect(params.rentGrowthPerYear).toBe(DEFAULT_FORECAST_PARAMETERS.rentGrowthPerYear); | ||
expect(params.constructionPriceGrowthPerYear).toBe(DEFAULT_FORECAST_PARAMETERS.constructionPriceGrowthPerYear); | ||
expect(params.propertyPriceGrowthPerYear).toBe(DEFAULT_FORECAST_PARAMETERS.propertyPriceGrowthPerYear); | ||
expect(params.yearsForecast).toBe(DEFAULT_FORECAST_PARAMETERS.yearsForecast); | ||
expect(params.affordabilityThresholdIncomePercentage).toBe(DEFAULT_FORECAST_PARAMETERS.affordabilityThresholdIncomePercentage); | ||
}); | ||
|
||
it("handles different maintenance percentage values", () => { | ||
const testCases = [0.015, 0.02, 0.0375]; | ||
|
||
testCases.forEach(maintenance => { | ||
const params = createForecastParameters(maintenance); | ||
expect(params.maintenancePercentage).toBe(maintenance); | ||
}); | ||
}); |