-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Security Solution] Test rule_details_ui/pages/rule_details/index.test.tsx
is too heavy and can fail by timeout
#147064
Comments
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-detections-response (Team:Detections and Resp) |
This is indeed a heavy and long-running test suite:
I think we shouldn't have unit tests for whole pages because they are too heavy, too brittle, require a lot of mocking, and are expensive in maintenance. We should probably just delete this test file or try to replace it with finer-grained and lightweight tests. |
rule_details_ui/pages/rule_details/index.test.tsx
is too heavy and can fail by timeout
…siness logic refactor (#164825) Fixes: #147064 ## Summary - `rule_details_ui/pages/rule_details/index.test.tsx` was too heavy and can fail by timeout - The unit test was mounting the whole rule details component to test: - redirection logic - which tabs are visible This PR: - extracts that logic into two new hooks and one component: - `useLegacyUrlRedirect` (for redirection logic) - `useRuleDetailsTabs` (to calculate which tabs should be displayed) - `LegacyUrlConflictCallOut` - adds tests for the two hooks and the component, covering all the logic that was previously covered by the `rule_details_ui/pages/rule_details/index.test.tsx` file - deletes the `rule_details_ui/pages/rule_details/index.test.tsx` file --------- Co-authored-by: kibanamachine <[email protected]>
A test failed on a tracked branch
First failure: CI Build - 8.6
The text was updated successfully, but these errors were encountered: