Commit 6431ca5
authored
[Fix] Jest Tests.x-pack/solutions/observability/plugins/exploratory_view/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.1 parent 7de4899 commit 6431ca5
1 file changed
Lines changed: 5 additions & 7 deletions
File tree
Lines changed: 5 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
19 | | - | |
| 18 | + | |
20 | 19 | | |
21 | 20 | | |
22 | 21 | | |
| |||
38 | 37 | | |
39 | 38 | | |
40 | 39 | | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
46 | 44 | | |
47 | 45 | | |
48 | 46 | | |
| |||
0 commit comments