From b02713d58d914f5a2aab12f7c06321c7260e0f2a Mon Sep 17 00:00:00 2001 From: Warren Lee <5959690+wrn14897@users.noreply.github.com> Date: Tue, 17 Nov 2026 13:08:20 -0800 Subject: [PATCH] test(e2e): only click a filter group header when it is closed openFilterGroup clicked the middle of the whole filter group. A group with an active filter auto-expands on load, so that click either collapsed the group or landed on a value row's hover "Only" button and replaced the selected filter. Read the accordion's data-active state, click only the header while closed, and retry until the group reports open. --- .../app/tests/e2e/components/FilterComponent.ts | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/packages/app/tests/e2e/components/FilterComponent.ts b/packages/app/tests/e2e/components/FilterComponent.ts index e500ec16f..63bfc914b 100644 --- a/packages/app/tests/e2e/components/FilterComponent.ts +++ b/packages/app/tests/e2e/components/FilterComponent.ts @@ -45,11 +45,21 @@ export class FilterComponent { } /** - * Open/expand a filter group (toggles — may close if already open) + * Open/expand a filter group. No-op if it is already open. */ async openFilterGroup(filterName: string) { const group = this.getFilterGroup(filterName); - await group.click(); + // Groups with an active filter auto-expand on load, so a blind click on the + // group could collapse it or land on a value row. Only click the header + // while the group is closed. + await expect(async () => { + if ((await group.getAttribute('data-active')) !== 'true') { + await group.getByTestId('filter-group-control').first().click(); + } + await expect(group).toHaveAttribute('data-active', 'true', { + timeout: 2000, + }); + }).toPass({ timeout: 20000 }); // The group animates open or closed. A row scrolled into view mid-animation // can slide back out of the panel, hiding any menu anchored to it, so wait // until the group's height holds still.