From d04f6ab2bf05027b906decc09e5ba9ffeb5f0471 Mon Sep 17 00:00:00 2001 From: Bruno Crosier Date: Mon, 9 Sep 2024 19:42:23 +0100 Subject: [PATCH] fix test --- test/fields/e2e.spec.ts | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/test/fields/e2e.spec.ts b/test/fields/e2e.spec.ts index 0b9b15b654..c911214924 100644 --- a/test/fields/e2e.spec.ts +++ b/test/fields/e2e.spec.ts @@ -471,15 +471,11 @@ describe('fields', () => { const fieldABox = await fieldA.boundingBox() const fieldBBox = await fieldB.boundingBox() - // Check that the top value of the fields are the same - // Give it some wiggle room of like 2px to account for differences in rendering - const tolerance = 2 - expect(fieldABox.y).toBeLessThanOrEqual(fieldBBox.y + tolerance) - - // Check that the widths of the fields are the same - const collapsibleDifference = Math.abs(fieldABox.width - fieldBBox.width) - - expect(collapsibleDifference).toBeLessThanOrEqual(tolerance) + await expect(() => { + // Check that the top value of the fields are the same + expect(fieldABox.y).toEqual(fieldBBox.y) + expect(fieldABox.height).toEqual(fieldBBox.height) + }).toPass() }) })