Skip to content

Commit 2293eb0

Browse files
author
Andrea
committed
test(e2e): use details.card to isolate history from Benessere accordion
The 'has: summary /Storico/' filter matched the outer Benessere accordion (because it contains the inner history <details> as descendant). Anchor to CSS class 'card' which only the inner history details has.
1 parent 4b4aba8 commit 2293eb0

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

frontend/e2e/wellbeing.spec.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,12 @@ test('il caregiver salva un check-in di benessere e lo ritrova nello storico', a
2222
await expect(page.getByText(/check-in salvato/i)).toBeVisible();
2323

2424
// Expand history and confirm the note we just saved is shown.
25-
// (AccountPage ora ha piu' <details> — gli accordion di sezione quindi
26-
// non basta first(): filtriamo per il summary "Storico (N)".)
27-
const details = page
28-
.locator('details')
29-
.filter({ has: page.locator('summary', { hasText: /^Storico/i }) })
30-
.first();
25+
// AccountPage e' fatta di piu' <details> (accordion di sezione), quindi
26+
// scegliamo esplicitamente il details.card interno del WellbeingSection
27+
// (l'unico che ha class "card" e summary che inizia con "Storico").
28+
const details = page.locator('details.card').filter({
29+
has: page.locator('summary', { hasText: /^Storico/i })
30+
});
3131
if (!(await details.evaluate((el: HTMLDetailsElement) => el.open))) {
3232
await details.locator('summary').click();
3333
}

0 commit comments

Comments
 (0)