Skip to content

[Cross-Cluster Replication] Migrate Enzyme to RTL#239643

Merged
kapral18 merged 6 commits intoelastic:mainfrom
kapral18:chore/cross-cluster-replication/migrate-to-rtl
Oct 21, 2025
Merged

[Cross-Cluster Replication] Migrate Enzyme to RTL#239643
kapral18 merged 6 commits intoelastic:mainfrom
kapral18:chore/cross-cluster-replication/migrate-to-rtl

Conversation

@kapral18
Copy link
Copy Markdown
Contributor

@kapral18 kapral18 commented Oct 18, 2025

Addresses #222608
Fixes #142774
Fixes #100951
Fixes #75261

Summary

This PR migrates the Cross-Cluster Replication (CCR) plugin's integration tests from Enzyme to React Testing Library (RTL).

Key Changes

  • Migrated 7 test files and their helper infrastructure from Enzyme to RTL (97/97 tests passing)
  • Unskipped and fixed 8 previously skipped tests
  • 21 files changed total

Technical Improvements

Helper Infrastructure

  • Created helpers/render.js for component rendering with routing & Redux
  • Added helpers/eui_table.js for EUI table interactions
  • Improved mock organization (split notifications.mock.ts from general mocks)

Test Quality

  • Fixed test isolation issues with fresh store creation per test
  • Eliminated act() warnings
  • Proper async handling with userEvent and fake timers

@kapral18 kapral18 self-assigned this Oct 18, 2025
@kapral18 kapral18 requested a review from a team as a code owner October 18, 2025 15:15
@kapral18 kapral18 added Feature:Cross Cluster Search Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Oct 18, 2025
@elasticmachine
Copy link
Copy Markdown
Contributor

Pinging @elastic/kibana-management (Team:Kibana Management)

@kapral18 kapral18 force-pushed the chore/cross-cluster-replication/migrate-to-rtl branch from c72806e to 62b012b Compare October 18, 2025 15:55
@kapral18 kapral18 force-pushed the chore/cross-cluster-replication/migrate-to-rtl branch from 62b012b to 6a114e1 Compare October 18, 2025 15:59
- improve test-perf by replacing user.type/click with fireEvent
@kapral18 kapral18 force-pushed the chore/cross-cluster-replication/migrate-to-rtl branch from 52d3d81 to 38e1f10 Compare October 19, 2025 18:46
Copy link
Copy Markdown
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

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

most changes lgtm, left few comments lmk what you think!

@kapral18 kapral18 requested a review from a team as a code owner October 20, 2025 18:52
@sabarasaba
Copy link
Copy Markdown
Member

@elasticmachine merge upstream

Copy link
Copy Markdown
Member

@sabarasaba sabarasaba left a comment

Choose a reason for hiding this comment

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

latest changes lgtm, nice job!

@elasticmachine
Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Test Failures

  • [job] [logs] FTR Configs #43 / serverless observability UI - Cases and Rules Serverless Observability Cases Case View properties adds a category to a case

Metrics [docs]

Public APIs missing comments

Total count of every public API that lacks a comment. Target amount is 0. Run node scripts/build_api_docs --plugin [yourplugin] --stats comments for more detailed information.

id before after diff
@kbn/test-eui-helpers 19 24 +5
Unknown metric groups

API count

id before after diff
@kbn/test-eui-helpers 37 47 +10

ESLint disabled line counts

id before after diff
crossClusterReplication 7 9 +2

Total ESLint disabled count

id before after diff
crossClusterReplication 9 11 +2

History

cc @kapral18

@kapral18 kapral18 merged commit 002cae9 into elastic:main Oct 21, 2025
12 checks passed
@kapral18 kapral18 deleted the chore/cross-cluster-replication/migrate-to-rtl branch October 21, 2025 18:27
NicholasPeretti pushed a commit to NicholasPeretti/kibana that referenced this pull request Oct 27, 2025
Addresses elastic#222608  
Fixes elastic#142774  
Fixes elastic#100951  
Fixes elastic#75261

## Summary

This PR migrates the Cross-Cluster Replication (CCR) plugin's
integration tests from Enzyme to React Testing Library (RTL).

### Key Changes
- Migrated 7 test files and their helper infrastructure from Enzyme to
RTL (97/97 tests passing)
- Unskipped and fixed 8 previously skipped tests
- 21 files changed total

### Technical Improvements

**Helper Infrastructure**
- Created `helpers/render.js` for component rendering with routing &
Redux
- Added `helpers/eui_table.js` for EUI table interactions
- Improved mock organization (split `notifications.mock.ts` from general
mocks)

**Test Quality**
- Fixed test isolation issues with fresh store creation per test
- Eliminated `act()` warnings
- Proper async handling with `userEvent` and fake timers

---------

Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment