Skip to content

[9.3] [Fix] Jest Tests.x-pack/solutions/observability/plugins/exploratory_view/public/components/shared/exploratory_view/components - FilterLabel should render properly (#262207)#262237

Merged
kibanamachine merged 2 commits into
elastic:9.3from
kibanamachine:backport/9.3/pr-262207
Apr 9, 2026

Conversation

@kibanamachine
Copy link
Copy Markdown
Contributor

…iew/public/components/shared/exploratory_view/components - FilterLabel should render properly (elastic#262207)

Resolves elastic#253320

**Root cause:** Anti-pattern of nesting findByText (async, retries)
inside waitFor (also retries). The FilterItem component re-renders due
to injectI18n() being called inside the render function, which makes
element references go stale between the findByText resolution and the
toBeInTheDocument() check.

**Fix:** Replaced with waitFor(() => { getByText... }) — synchronous
assertions inside waitFor so all checks run atomically in one retry
cycle. Removed the duplicate assertion and unskipped the test.

Verified: 155/155 consecutive runs pass locally.
(cherry picked from commit 6431ca5)
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/obs-ux-management-team (Team:obs-ux-management)

@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

cc @ana-davydova

@kibanamachine kibanamachine merged commit 2e97da0 into elastic:9.3 Apr 9, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport This PR is a backport of another PR Team:obs-ux-management

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants