Skip to content

Commit

Permalink
feat: add new test for updated depreciation
Browse files Browse the repository at this point in the history
  • Loading branch information
zz-hh-aa committed Nov 22, 2024
1 parent 0e73efb commit 0832891
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions app/models/Property.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,23 @@ it("correctly calculates the newBuildPrice", () => {
expect(property.newBuildPrice).toBeCloseTo(186560);
});

it("correctly calculates the depreciatedBuildPrice", () => {
expect(property.depreciatedBuildPrice).toBeCloseTo(110717.45);
it("correctly calculates the depreciatedBuildPrice for existing builds (age > 0)", () => {
expect(property.depreciatedBuildPrice).toBeCloseTo(172988.92);
});

it("correctly calculates depreciatedBuildPrice for newbuilds (age = 0)", () => {
property = new Property({
postcode: "WV8 1HG",
houseType: "T",
numberOfBedrooms: 2,
age: 1,
size: 88,
maintenancePercentage: 0.02,
newBuildPricePerMetre: 2120,
averageMarketPrice: 218091.58,
itl3: "TLG24",
});
expect(property.depreciatedBuildPrice).toBeCloseTo(186560)
});

it("correctly calculates the bedWeightedAveragePrice", () => {
Expand Down

0 comments on commit 0832891

Please sign in to comment.