diff --git a/tests/Data/Food/RecipeTest.elm b/tests/Data/Food/RecipeTest.elm index c8b2c0f77..6668dd0cf 100644 --- a/tests/Data/Food/RecipeTest.elm +++ b/tests/Data/Food/RecipeTest.elm @@ -24,7 +24,7 @@ expectImpactEqual expectedImpactUnit = Unit.impactToFloat expectedImpactUnit in Unit.impactToFloat - >> Expect.within (Expect.Relative 0.0000000000000001) expectedImpact + >> Expect.within (Expect.Relative 0.000000000001) expectedImpact suite : Test diff --git a/tests/server.spec.js b/tests/server.spec.js index 4246f5a7b..c3e1fbdd4 100644 --- a/tests/server.spec.js +++ b/tests/server.spec.js @@ -551,8 +551,15 @@ describe("API", () => { scoring: response.status === 200 ? response.body.results.scoring : {}, }); expectStatus(response, 200); - expect(response.body.results.total).toEqual(impacts); - expect(response.body.results.scoring).toEqual(scoring); + + // Add tolerance check for impacts + Object.entries(impacts).forEach(([key, value]) => { + expect(response.body.results.total[key]).toBeCloseTo(value, 12); + }); + + Object.entries(scoring).forEach(([key, value]) => { + expect(response.body.results.scoring[key]).toBeCloseTo(value, 12); + }); }); } });