diff --git a/tests/e2e/switch.test.e2e.ts b/tests/e2e/switch.test.e2e.ts index 6c7b33bbf6..2a42612dc4 100644 --- a/tests/e2e/switch.test.e2e.ts +++ b/tests/e2e/switch.test.e2e.ts @@ -70,6 +70,5 @@ test('Switch CSS properties', async ({browser}) => { // E2E already runs clients with both fine and coarse pointer simulated // This test will verify that coarse-related CSS is working as intended const itemHeight = await page.evaluate(() => window.matchMedia('(pointer: coarse)').matches) ? 38 : 34; - // In Firefox Math.round is needed because .height is 33.99998474121094 - expect(Math.round((await page.locator('#issue-filters .switch > .item:nth-child(1)').boundingBox()).height)).toBe(itemHeight); + expect((await page.locator('#issue-filters .switch > .item:nth-child(1)').boundingBox()).height).toBeCloseTo(itemHeight); }); diff --git a/tests/e2e/user-cards.test.e2e.ts b/tests/e2e/user-cards.test.e2e.ts index 22c31965d6..3d1989493f 100644 --- a/tests/e2e/user-cards.test.e2e.ts +++ b/tests/e2e/user-cards.test.e2e.ts @@ -20,10 +20,10 @@ test('Usercards width', async ({page}) => { for (let i = 1; i <= amount; i++) { const card = await page.locator(`.user-cards .card:nth-child(${i})`).boundingBox(); - widths.push(Math.round(card.width)); + widths.push(card.width); } for (const width of widths) { - expect(width).toBe(widths[0]); + expect(width).toBeCloseTo(widths[0], 0); } });