Skip to content

[8.19] [Security Solution] Add rule upgrade preview FE integration tests (Rule Upgrade Flyout) (#210377)#225548

Merged
maximpn merged 6 commits intoelastic:8.19from
maximpn:backport/8.19/pr-210377
Jul 4, 2025
Merged

[8.19] [Security Solution] Add rule upgrade preview FE integration tests (Rule Upgrade Flyout) (#210377)#225548
maximpn merged 6 commits intoelastic:8.19from
maximpn:backport/8.19/pr-210377

Conversation

@maximpn
Copy link
Copy Markdown
Contributor

@maximpn maximpn commented Jun 26, 2025

Backport

This will backport the following commits from main to 8.19:

Questions ?

Please refer to the Backport tool documentation

…le Upgrade Flyout) (elastic#210377)

**Partially addresses:** elastic#205645

## Summary

This PR implements Frontend integration tests from the [upgrading prebuilt rules one-by-one with preview test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_upgrade_with_preview.md).

## Details

This PR add Jest integration tests (`@kbn/test/jest_integration` preset) for Rule Upgrade Flyout. Test scenarios are described in [upgrading prebuilt rules one-by-one with preview test plan](https://github.com/elastic/kibana/blob/main/x-pack/solutions/security/plugins/security_solution/docs/testing/test_plans/detection_response/prebuilt_rules/prebuilt_rule_upgrade_with_preview.md).

Tests cover each `diffable rule` field separately to guarantee visibility on broken functionality.

`esql_query` and `threat_mapping` fields were skipped due to mocking difficulties.

### Tests setup

- Rules Management page is used as the root component to test functionality in integration
- HTTP responses are mocked via mocking return values from `Kibana.http.fetch()` method
- Test scenarios are the same for each diffable rule field and moved out to reusable utility functions

(cherry picked from commit ea7ccca)

# Conflicts:
#	packages/kbn-babel-preset/styled_components_files.js
#	x-pack/solutions/security/plugins/security_solution/public/common/lib/kibana/kibana_react.mock.ts
@maximpn maximpn requested a review from kibanamachine as a code owner June 26, 2025 20:16
@maximpn maximpn added the backport This PR is a backport of another PR label Jun 26, 2025
@maximpn maximpn enabled auto-merge (squash) June 26, 2025 20:16
@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Async chunks

Total size of all lazy-loaded chunks that will be downloaded as the user navigates the app

id before after diff
securitySolution 9.4MB 9.4MB +496.0B
Unknown metric groups

ESLint disabled line counts

id before after diff
securitySolution 566 568 +2

Total ESLint disabled count

id before after diff
securitySolution 653 655 +2

History

Copy link
Copy Markdown
Contributor

@jkelas jkelas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I confirm this backport contains identical changes as the original PR.
I am approving.

@maximpn maximpn merged commit 31625c4 into elastic:8.19 Jul 4, 2025
9 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants