diff --git a/src/renderer/src/components/linear-issue-attribute-filter-dropdowns.test.tsx b/src/renderer/src/components/linear-issue-attribute-filter-dropdowns.test.tsx index 3fb43720fcd..8fa3956959d 100644 --- a/src/renderer/src/components/linear-issue-attribute-filter-dropdowns.test.tsx +++ b/src/renderer/src/components/linear-issue-attribute-filter-dropdowns.test.tsx @@ -182,10 +182,7 @@ describe('LinearIssueAttributeFilterDropdowns', () => { // Why: restored filters render before the team fetch settles, when availableTeams is // still the issue-scraped subset — pruning there deletes another team's facets for good. - it.each([ - [false, false], - [true, true] - ])('prunes unknown facet ids only once teams are settled (%s)', (teamsSettled, expectPrune) => { + it('prunes unknown facet ids only once teams settle on the mounted component', () => { const team: LinearTeam = { id: 'team-1', name: 'Engineering', key: 'ENG' } const onChange = vi.fn() const container = document.createElement('div') @@ -193,31 +190,33 @@ describe('LinearIssueAttributeFilterDropdowns', () => { const root = createRoot(container) roots.push(root) - act(() => { - root.render( - - ) - }) - - if (expectPrune) { - expect(onChange).toHaveBeenCalledWith( - expect.objectContaining({ stateIds: [], labelIds: [], assignee: null }) - ) - } else { - expect(onChange).not.toHaveBeenCalled() + const renderWith = (teamsSettled: boolean): void => { + act(() => { + root.render( + + ) + }) } + + renderWith(false) + expect(onChange).not.toHaveBeenCalled() + + renderWith(true) + expect(onChange).toHaveBeenCalledWith( + expect.objectContaining({ stateIds: [], labelIds: [], assignee: null }) + ) }) }) diff --git a/tests/e2e/linear-issue-view-persistence.spec.ts b/tests/e2e/linear-issue-view-persistence.spec.ts index 40c69b59c46..6621b86df81 100644 --- a/tests/e2e/linear-issue-view-persistence.spec.ts +++ b/tests/e2e/linear-issue-view-persistence.spec.ts @@ -253,17 +253,17 @@ async function openViewMenu(page: Page): Promise { } async function dismissOverlayChrome(page: Page): Promise { - // Why: open Radix menus aria-hide the rest of the page so later getByRole for - // Filters/chips fails. Escape is unsafe (Tasks treats it as leave-page). Click - // the issues heading, which stays outside the menu portal. - if ( - (await page.getByRole('menuitemradio', { name: 'Board' }).count()) === 0 && - (await page.locator('[data-slot="popover-content"]').count()) === 0 - ) { - return + // Why: open Radix menus aria-hide/inert the rest of the page so later getByRole + // for Filters/chips fails. Escape is unsafe (Tasks treats it as leave-page). + // Force-clicking inert page chrome does not close modal menus in headless CI — + // toggle the View trigger (not inert) and the Filters button for popovers. + if ((await page.getByRole('menuitemradio', { name: 'Board' }).count()) > 0) { + await page.getByRole('button', { name: 'View', exact: true }).click() + } + if ((await page.locator('[data-slot="popover-content"]').count()) > 0) { + const filtersButton = page.getByRole('button', { name: 'Filters', exact: true }) + await ((await filtersButton.count()) > 0 ? filtersButton.click() : page.mouse.click(24, 24)) } - const heading = page.getByText('Linear issues', { exact: true }).first() - await ((await heading.count()) > 0 ? heading.click({ force: true }) : page.mouse.click(24, 24)) await expect(page.getByRole('menuitemradio', { name: 'Board' })).toHaveCount(0) await expect(page.locator('[data-slot="popover-content"]')).toHaveCount(0) }