From 59413a8b640208a266d6e2caf167b07fb421b530 Mon Sep 17 00:00:00 2001 From: kristianwind Date: Thu, 3 Sep 2026 10:09:32 +0200 Subject: [PATCH] test(e2e): a grouped project now shares the left margin, not indented The sidebar redesign puts every project at the same left edge; flip the assertion from "indented more than a fixed view" to "in line with it". Co-Authored-By: Claude Opus 4.8 --- web/e2e/smoke.spec.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/web/e2e/smoke.spec.js b/web/e2e/smoke.spec.js index 850ad2e..87ba42e 100644 --- a/web/e2e/smoke.spec.js +++ b/web/e2e/smoke.spec.js @@ -485,10 +485,10 @@ test('en projektgruppe kan foldes, fyldes og slettes uden at tage projekterne me .evaluate((el) => el.getBoundingClientRect().left + parseFloat(getComputedStyle(el).paddingLeft)); expect(headLeft, 'gruppehovedet er rykket ind').toBeLessThanOrEqual(looseLeft); - // A project inside a group starts further in than a row outside one. Measured - // rather than asserted on a class, because indentation is a fact about where - // the row's contents land — and measured at the *content* edge, not the box: - // the indent is padding, so the element's own left edge does not move. + // A project sits at the same left margin whether or not it is in a group — one + // straight edge down the sidebar, with the bold heading doing the grouping the + // indent used to. Measured at the *content* edge, not the box, because what the + // eye follows is where the text lands. await sidebar.getByRole('link', { name: 'Regnskab' }).dragTo(heading); const contentLeft = (el) => el.getBoundingClientRect().left + parseFloat(getComputedStyle(el).paddingLeft); @@ -496,7 +496,10 @@ test('en projektgruppe kan foldes, fyldes og slettes uden at tage projekterne me sidebar.locator('.folder > a').first().evaluate(contentLeft), sidebar.locator('.views a').first().evaluate(contentLeft) ]); - expect(inside, 'et projekt i en gruppe er ikke rykket ind').toBeGreaterThan(outside); + expect( + Math.abs(inside - outside), + 'et projekt i en gruppe står ikke i flugt med de faste visninger' + ).toBeLessThan(2); await sidebar .getByRole('link', { name: 'Regnskab' })