Commit 75cbfa9
authored
[Presentation] Fix slow FilterItems tests (#238401)
## Summary
Fixes #237143
Fixes #235143
Summarize your PR. If it involves visual changes include a screenshot or
gif.
Fixes slow tests in dashboard and presentation panel components by
mocking the `FilterItems` component from
`@kbn/unified-search-plugin/public`.
## Problem
Two test we causing timeouts on CI. Locally, they were getting these
results:
- `customize_panel_editor.test.tsx`: "renders local filters, if
provided" test took **367ms**
- `filters_notification_popover.test.tsx`: "renders the filter section
when given filters"
test took **962ms**
The root cause was that `FilterItems` is a complex component with
lazy-loaded dependencies
that caused:
- Expensive rendering operations
- React Suspense delays
- Unnecessary overhead for tests that only verify component structure
## Solution
Added a mock for `FilterItems` in both test files to replace the heavy
component with a
simple mock implementation. This avoids loading the entire unified
search plugin
infrastructure during tests.
## Performance Improvements
- **customize_panel_editor.test.tsx**: 367ms → 10ms (97% faster)
- **filters_notification_popover.test.tsx**: 962ms → 68ms (93% faster)1 parent df167c7 commit 75cbfa9
2 files changed
Lines changed: 10 additions & 0 deletions
File tree
- src/platform/plugins
- private/presentation_panel/public/panel_actions/customize_panel_action
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
21 | 26 | | |
22 | 27 | | |
23 | 28 | | |
| |||
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
22 | 27 | | |
23 | 28 | | |
24 | 29 | | |
| |||
0 commit comments