Skip to content

Commit

Permalink
chore: update tests following new fh formula
Browse files Browse the repository at this point in the history
  • Loading branch information
zz-hh-aa committed Nov 22, 2024
1 parent bf2eead commit b64cefd
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions app/models/Fairhold.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,18 @@ it("can be instantiated", () => {

it("correctly calculates the fairhold formula below the threshold", () => {
const fairhold = new Fairhold({
affordability: 0.05,
affordability: 0.15,
landPriceOrRent: 100,
});
expect(fairhold.discountLand).toBeCloseTo(0.6877641290737884);
expect(fairhold.discountLand).toBeCloseTo(0.535);
});

it("correctly calculates the fairhold formula above the threshold", () => {
const fairhold = new Fairhold({
affordability: 0.05,
affordability: 0.5,
landPriceOrRent: 100,
plateau: 3,
});
expect(fairhold.discountLand).toBeCloseTo(0.68776);
expect(fairhold.discountLand).toBeCloseTo(0.15);
});

it("correctly deals with negative values of landPriceOrRent", () => {
Expand Down

0 comments on commit b64cefd

Please sign in to comment.