Skip to content

[Snapshot Restore] Migrate flaky repository_add integration test to unit tests#258974

Merged
kapral18 merged 1 commit intoelastic:mainfrom
kapral18:chore/snapshot-restore/fix-repository-add-flaky-test-248548
Mar 27, 2026
Merged

[Snapshot Restore] Migrate flaky repository_add integration test to unit tests#258974
kapral18 merged 1 commit intoelastic:mainfrom
kapral18:chore/snapshot-restore/fix-repository-add-flaky-test-248548

Conversation

@kapral18
Copy link
Copy Markdown
Contributor

@kapral18 kapral18 commented Mar 22, 2026

Closes #248548

Summary

  • Migrates flaky repository_add client integration test to focused unit tests spread across the source files that own the functionality.
  • Removes the legacy __jest__/client_integration/repository_add.test.ts integration test.
  • Unskips the previously flaky settings validation test (now a pure function test — no timeouts possible).

Rationale

Coverage mapping

Test Plan

  • node scripts/check_changes.ts — passed
  • yarn test:jest x-pack/platform/plugins/private/snapshot_restore/public/application/services/validation/validate_repository.test.ts — 24 passed
  • yarn test:jest x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.test.tsx — 10 passed
  • yarn test:jest x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/repository_form.test.tsx — 14 passed
  • yarn test:jest x-pack/platform/plugins/private/snapshot_restore/public/application/sections/repository_add/repository_add.test.tsx — 1 passed

Assisted with Claude Code using Claude 4.6 Opus

@kapral18 kapral18 requested a review from a team as a code owner March 22, 2026 02:27
@kapral18 kapral18 added Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// Feature:Snapshot and Restore Elasticsearch snapshots and repositories UI release_note:skip Skip the PR/issue when compiling release notes backport:skip This PR does not require backporting labels Mar 22, 2026
@elasticmachine
Copy link
Copy Markdown
Contributor

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

@kapral18 kapral18 force-pushed the chore/snapshot-restore/fix-repository-add-flaky-test-248548 branch from bc758ad to e762e88 Compare March 22, 2026 02:31
@kapral18
Copy link
Copy Markdown
Contributor Author

@coderabbitai full review

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 22, 2026

✅ Actions performed

Full review triggered.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 22, 2026

Caution

Review failed

The head commit changed during the review from 9934d8e to 7ce895a.

📝 Walkthrough

Walkthrough

The change replaces a large integration test file for repository add with focused unit tests. The deleted 714-line integration test is removed and four new test files are added: repository_form.test.tsx (step navigation and submission), step_one.test.tsx (type selection and step-1 behavior), validate_repository.test.ts (validation logic across types and settings), and repository_add.test.tsx (section smoke test). Tests mock repository type loading, doc links, and relevant hooks to exercise UI flows and validator behavior in isolation.

🚥 Pre-merge checks | ✅ 2
✅ Passed checks (2 passed)
Check name Status Explanation
Linked Issues check ✅ Passed PR successfully addresses the flaky integration test timeout (#248548) by migrating to deterministic unit tests with comprehensive coverage of validation, form submission, and UI interactions.
Out of Scope Changes check ✅ Passed All changes are directly scoped to the linked issue: removing the flaky integration test and adding focused unit tests for the RepositoryAdd form and validation logic.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • 🛠️ Update Documentation: Commit on current branch
  • 🛠️ Update Documentation: Create PR

Comment @coderabbitai help to get the list of available commands and usage tips.

Tip

CodeRabbit can generate a title for your PR based on the changes.

Add @coderabbitai placeholder anywhere in the title of your PR and CodeRabbit will replace it with a title based on the changes in the PR. You can change the placeholder by changing the reviews.auto_title_placeholder setting.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 22, 2026

✅ Actions performed

Full review triggered.

1 similar comment
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 22, 2026

✅ Actions performed

Full review triggered.

@kapral18 kapral18 force-pushed the chore/snapshot-restore/fix-repository-add-flaky-test-248548 branch 2 times, most recently from 9934d8e to 7ce895a Compare March 22, 2026 14:47
@kapral18 kapral18 added v9.4.0 v9.3.3 backport:version Backport to applied version labels and removed backport:skip This PR does not require backporting labels Mar 22, 2026
@kapral18 kapral18 force-pushed the chore/snapshot-restore/fix-repository-add-flaky-test-248548 branch 2 times, most recently from 1162b9f to 2c77d81 Compare March 24, 2026 20:29
@elasticmachine
Copy link
Copy Markdown
Contributor

💚 Build Succeeded

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
snapshotRestore 252.6KB 252.6KB +53.0B

Page load bundle

Size of the bundles that are downloaded on every page load. Target size is below 100kb

id before after diff
snapshotRestore 19.6KB 19.7KB +62.0B

@kapral18 kapral18 requested a review from SoniaSanzV March 26, 2026 20:45
…nit tests

- Removes flaky `repository_add.test.ts` client integration test
- Adds pure unit tests for `validateRepository` (24 tests)
- Adds unit tests for `RepositoryFormStepOne` (10 tests)
- Adds unit tests for `RepositoryForm` orchestration and payloads (14 tests)
- Adds unit test for `RepositoryAdd` page title (1 test)
- Unskips previously flaky settings validation (issue elastic#248548)

Closes elastic#248548

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kapral18 kapral18 force-pushed the chore/snapshot-restore/fix-repository-add-flaky-test-248548 branch from 2c77d81 to bf1e1eb Compare March 27, 2026 11:22
@kapral18 kapral18 enabled auto-merge (squash) March 27, 2026 11:22
@kapral18 kapral18 merged commit 6b62324 into elastic:main Mar 27, 2026
18 checks passed
@kibanamachine
Copy link
Copy Markdown
Contributor

Starting backport for target branches: 9.3

https://github.com/elastic/kibana/actions/runs/23646540099

@kibanamachine
Copy link
Copy Markdown
Contributor

💔 All backports failed

Status Branch Result
9.3 Backport failed because of merge conflicts

You might need to backport the following PRs to 9.3:
- chore: clean cache before moving on with other jobs (#259930)
- [Upgrade Assistant] Migrate Kibana deprecations flaky integration tests to unit tests (#258981)
- [Upgrade Assistant] Migrate ES deprecations flaky integration tests to unit tests (#258142)
- [Index Management] Migrate flaky integration tests to unit tests (#258942)

Manual backport

To create the backport manually run:

node scripts/backport --pr 258974

Questions ?

Please refer to the Backport tool documentation

kelvtanv pushed a commit to kelvtanv/kibana that referenced this pull request Mar 27, 2026
…nit tests (elastic#258974)

Closes elastic#248548

## Summary

- Migrates flaky `repository_add` client integration test to focused
unit tests spread across the source files that own the functionality.
- Removes the legacy
`__jest__/client_integration/repository_add.test.ts` integration test.
- Unskips the previously flaky settings validation test (now a pure
function test — no timeouts possible).

## Rationale

- The old integration test rendered the full app through a router with
async HTTP mock layers, causing flaky 5000ms timeouts on CI (issue
elastic#248548).
- The new unit tests render components directly with minimal mocks, use
synchronous `fireEvent`, and test validation as pure function calls.

## Coverage mapping

- [Integration → unit test mapping
(gist)](https://gist.github.com/kapral18/b6ccde9cbf84bc18c35fc356861aba50)

## Test Plan

- `node scripts/check_changes.ts` — passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/services/validation/validate_repository.test.ts`
— 24 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.test.tsx`
— 10 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/repository_form.test.tsx`
— 14 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/sections/repository_add/repository_add.test.tsx`
— 1 passed

Assisted with Claude Code using Claude 4.6 Opus

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@kapral18 kapral18 deleted the chore/snapshot-restore/fix-repository-add-flaky-test-248548 branch March 27, 2026 16:40
kapral18 added a commit to kapral18/kibana that referenced this pull request Mar 28, 2026
…nit tests (elastic#258974)

Closes elastic#248548

- Migrates flaky `repository_add` client integration test to focused
unit tests spread across the source files that own the functionality.
- Removes the legacy
`__jest__/client_integration/repository_add.test.ts` integration test.
- Unskips the previously flaky settings validation test (now a pure
function test — no timeouts possible).

- The old integration test rendered the full app through a router with
async HTTP mock layers, causing flaky 5000ms timeouts on CI (issue
- The new unit tests render components directly with minimal mocks, use
synchronous `fireEvent`, and test validation as pure function calls.

- [Integration → unit test mapping
(gist)](https://gist.github.com/kapral18/b6ccde9cbf84bc18c35fc356861aba50)

- `node scripts/check_changes.ts` — passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/services/validation/validate_repository.test.ts`
— 24 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.test.tsx`
— 10 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/repository_form.test.tsx`
— 14 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/sections/repository_add/repository_add.test.tsx`
— 1 passed

Assisted with Claude Code using Claude 4.6 Opus

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit 6b62324)
@kapral18
Copy link
Copy Markdown
Contributor Author

💚 All backports created successfully

Status Branch Result
9.3

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kapral18 added a commit to kapral18/kibana that referenced this pull request Mar 30, 2026
…nit tests (elastic#258974)

Closes elastic#248548

- Migrates flaky `repository_add` client integration test to focused
unit tests spread across the source files that own the functionality.
- Removes the legacy
`__jest__/client_integration/repository_add.test.ts` integration test.
- Unskips the previously flaky settings validation test (now a pure
function test — no timeouts possible).

- The old integration test rendered the full app through a router with
async HTTP mock layers, causing flaky 5000ms timeouts on CI (issue
- The new unit tests render components directly with minimal mocks, use
synchronous `fireEvent`, and test validation as pure function calls.

- [Integration → unit test mapping
(gist)](https://gist.github.com/kapral18/b6ccde9cbf84bc18c35fc356861aba50)

- `node scripts/check_changes.ts` — passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/services/validation/validate_repository.test.ts`
— 24 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.test.tsx`
— 10 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/repository_form.test.tsx`
— 14 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/sections/repository_add/repository_add.test.tsx`
— 1 passed

Assisted with Claude Code using Claude 4.6 Opus

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit 6b62324)
SoniaSanzV pushed a commit to SoniaSanzV/kibana that referenced this pull request Mar 30, 2026
…nit tests (elastic#258974)

Closes elastic#248548

## Summary

- Migrates flaky `repository_add` client integration test to focused
unit tests spread across the source files that own the functionality.
- Removes the legacy
`__jest__/client_integration/repository_add.test.ts` integration test.
- Unskips the previously flaky settings validation test (now a pure
function test — no timeouts possible).

## Rationale

- The old integration test rendered the full app through a router with
async HTTP mock layers, causing flaky 5000ms timeouts on CI (issue
elastic#248548).
- The new unit tests render components directly with minimal mocks, use
synchronous `fireEvent`, and test validation as pure function calls.

## Coverage mapping

- [Integration → unit test mapping
(gist)](https://gist.github.com/kapral18/b6ccde9cbf84bc18c35fc356861aba50)

## Test Plan

- `node scripts/check_changes.ts` — passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/services/validation/validate_repository.test.ts`
— 24 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.test.tsx`
— 10 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/repository_form.test.tsx`
— 14 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/sections/repository_add/repository_add.test.tsx`
— 1 passed

Assisted with Claude Code using Claude 4.6 Opus

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
kapral18 added a commit to kapral18/kibana that referenced this pull request Mar 30, 2026
…nit tests (elastic#258974)

Closes elastic#248548

- Migrates flaky `repository_add` client integration test to focused
unit tests spread across the source files that own the functionality.
- Removes the legacy
`__jest__/client_integration/repository_add.test.ts` integration test.
- Unskips the previously flaky settings validation test (now a pure
function test — no timeouts possible).

- The old integration test rendered the full app through a router with
async HTTP mock layers, causing flaky 5000ms timeouts on CI (issue
- The new unit tests render components directly with minimal mocks, use
synchronous `fireEvent`, and test validation as pure function calls.

- [Integration → unit test mapping
(gist)](https://gist.github.com/kapral18/b6ccde9cbf84bc18c35fc356861aba50)

- `node scripts/check_changes.ts` — passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/services/validation/validate_repository.test.ts`
— 24 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.test.tsx`
— 10 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/repository_form.test.tsx`
— 14 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/sections/repository_add/repository_add.test.tsx`
— 1 passed

Assisted with Claude Code using Claude 4.6 Opus

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
(cherry picked from commit 6b62324)
kapral18 added a commit that referenced this pull request Mar 31, 2026
…t to unit tests (#258974) (#260128)

# Backport

This will backport the following commits from `main` to `9.3`:
- [[Snapshot Restore] Migrate flaky repository_add integration test to
unit tests (#258974)](#258974)

<!--- Backport version: 11.0.1 -->

### Questions ?
Please refer to the [Backport tool
documentation](https://github.com/sorenlouv/backport)

<!--BACKPORT [{"author":{"name":"Karen
Grigoryan","email":"karen.grigoryan@elastic.co"},"sourceCommit":{"committedDate":"2026-03-27T12:37:40Z","message":"[Snapshot
Restore] Migrate flaky repository_add integration test to unit tests
(#258974)\n\nCloses #248548\n\n## Summary\n\n- Migrates flaky
`repository_add` client integration test to focused\nunit tests spread
across the source files that own the functionality.\n- Removes the
legacy\n`__jest__/client_integration/repository_add.test.ts` integration
test.\n- Unskips the previously flaky settings validation test (now a
pure\nfunction test — no timeouts possible).\n\n## Rationale\n\n- The
old integration test rendered the full app through a router with\nasync
HTTP mock layers, causing flaky 5000ms timeouts on CI
(issue\n#248548).\n- The new unit tests render components directly with
minimal mocks, use\nsynchronous `fireEvent`, and test validation as pure
function calls.\n\n## Coverage mapping\n\n- [Integration → unit test
mapping\n(gist)](https://gist.github.com/kapral18/b6ccde9cbf84bc18c35fc356861aba50)\n\n##
Test Plan\n\n- `node scripts/check_changes.ts` — passed\n- `yarn
test:jest\nx-pack/platform/plugins/private/snapshot_restore/public/application/services/validation/validate_repository.test.ts`\n—
24 passed\n- `yarn
test:jest\nx-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.test.tsx`\n—
10 passed\n- `yarn
test:jest\nx-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/repository_form.test.tsx`\n—
14 passed\n- `yarn
test:jest\nx-pack/platform/plugins/private/snapshot_restore/public/application/sections/repository_add/repository_add.test.tsx`\n—
1 passed\n\nAssisted with Claude Code using Claude 4.6
Opus\n\nCo-authored-by: Claude Opus 4.6 (1M context)
<noreply@anthropic.com>","sha":"6b62324cd6ebd0313558a9ce1b8051f7a72600b9","branchLabelMapping":{"^v9.4.0$":"main","^v(\\d+).(\\d+).\\d+$":"$1.$2"}},"sourcePullRequest":{"labels":["Team:Kibana
Management","release_note:skip","Feature:Snapshot and
Restore","backport:version","v9.4.0","v9.3.3"],"title":"[Snapshot
Restore] Migrate flaky repository_add integration test to unit
tests","number":258974,"url":"https://github.com/elastic/kibana/pull/258974","mergeCommit":{"message":"[Snapshot
Restore] Migrate flaky repository_add integration test to unit tests
(#258974)\n\nCloses #248548\n\n## Summary\n\n- Migrates flaky
`repository_add` client integration test to focused\nunit tests spread
across the source files that own the functionality.\n- Removes the
legacy\n`__jest__/client_integration/repository_add.test.ts` integration
test.\n- Unskips the previously flaky settings validation test (now a
pure\nfunction test — no timeouts possible).\n\n## Rationale\n\n- The
old integration test rendered the full app through a router with\nasync
HTTP mock layers, causing flaky 5000ms timeouts on CI
(issue\n#248548).\n- The new unit tests render components directly with
minimal mocks, use\nsynchronous `fireEvent`, and test validation as pure
function calls.\n\n## Coverage mapping\n\n- [Integration → unit test
mapping\n(gist)](https://gist.github.com/kapral18/b6ccde9cbf84bc18c35fc356861aba50)\n\n##
Test Plan\n\n- `node scripts/check_changes.ts` — passed\n- `yarn
test:jest\nx-pack/platform/plugins/private/snapshot_restore/public/application/services/validation/validate_repository.test.ts`\n—
24 passed\n- `yarn
test:jest\nx-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.test.tsx`\n—
10 passed\n- `yarn
test:jest\nx-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/repository_form.test.tsx`\n—
14 passed\n- `yarn
test:jest\nx-pack/platform/plugins/private/snapshot_restore/public/application/sections/repository_add/repository_add.test.tsx`\n—
1 passed\n\nAssisted with Claude Code using Claude 4.6
Opus\n\nCo-authored-by: Claude Opus 4.6 (1M context)
<noreply@anthropic.com>","sha":"6b62324cd6ebd0313558a9ce1b8051f7a72600b9"}},"sourceBranch":"main","suggestedTargetBranches":["9.3"],"targetPullRequestStates":[{"branch":"main","label":"v9.4.0","branchLabelMappingKey":"^v9.4.0$","isSourceBranch":true,"state":"MERGED","url":"https://github.com/elastic/kibana/pull/258974","number":258974,"mergeCommit":{"message":"[Snapshot
Restore] Migrate flaky repository_add integration test to unit tests
(#258974)\n\nCloses #248548\n\n## Summary\n\n- Migrates flaky
`repository_add` client integration test to focused\nunit tests spread
across the source files that own the functionality.\n- Removes the
legacy\n`__jest__/client_integration/repository_add.test.ts` integration
test.\n- Unskips the previously flaky settings validation test (now a
pure\nfunction test — no timeouts possible).\n\n## Rationale\n\n- The
old integration test rendered the full app through a router with\nasync
HTTP mock layers, causing flaky 5000ms timeouts on CI
(issue\n#248548).\n- The new unit tests render components directly with
minimal mocks, use\nsynchronous `fireEvent`, and test validation as pure
function calls.\n\n## Coverage mapping\n\n- [Integration → unit test
mapping\n(gist)](https://gist.github.com/kapral18/b6ccde9cbf84bc18c35fc356861aba50)\n\n##
Test Plan\n\n- `node scripts/check_changes.ts` — passed\n- `yarn
test:jest\nx-pack/platform/plugins/private/snapshot_restore/public/application/services/validation/validate_repository.test.ts`\n—
24 passed\n- `yarn
test:jest\nx-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.test.tsx`\n—
10 passed\n- `yarn
test:jest\nx-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/repository_form.test.tsx`\n—
14 passed\n- `yarn
test:jest\nx-pack/platform/plugins/private/snapshot_restore/public/application/sections/repository_add/repository_add.test.tsx`\n—
1 passed\n\nAssisted with Claude Code using Claude 4.6
Opus\n\nCo-authored-by: Claude Opus 4.6 (1M context)
<noreply@anthropic.com>","sha":"6b62324cd6ebd0313558a9ce1b8051f7a72600b9"}},{"branch":"9.3","label":"v9.3.3","branchLabelMappingKey":"^v(\\d+).(\\d+).\\d+$","isSourceBranch":false,"state":"NOT_CREATED"}]}]
BACKPORT-->

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
jeramysoucy pushed a commit to jeramysoucy/kibana that referenced this pull request Apr 1, 2026
…nit tests (elastic#258974)

Closes elastic#248548

## Summary

- Migrates flaky `repository_add` client integration test to focused
unit tests spread across the source files that own the functionality.
- Removes the legacy
`__jest__/client_integration/repository_add.test.ts` integration test.
- Unskips the previously flaky settings validation test (now a pure
function test — no timeouts possible).

## Rationale

- The old integration test rendered the full app through a router with
async HTTP mock layers, causing flaky 5000ms timeouts on CI (issue
elastic#248548).
- The new unit tests render components directly with minimal mocks, use
synchronous `fireEvent`, and test validation as pure function calls.

## Coverage mapping

- [Integration → unit test mapping
(gist)](https://gist.github.com/kapral18/b6ccde9cbf84bc18c35fc356861aba50)

## Test Plan

- `node scripts/check_changes.ts` — passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/services/validation/validate_repository.test.ts`
— 24 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.test.tsx`
— 10 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/repository_form.test.tsx`
— 14 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/sections/repository_add/repository_add.test.tsx`
— 1 passed

Assisted with Claude Code using Claude 4.6 Opus

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
paulinashakirova pushed a commit to paulinashakirova/kibana that referenced this pull request Apr 2, 2026
…nit tests (elastic#258974)

Closes elastic#248548

## Summary

- Migrates flaky `repository_add` client integration test to focused
unit tests spread across the source files that own the functionality.
- Removes the legacy
`__jest__/client_integration/repository_add.test.ts` integration test.
- Unskips the previously flaky settings validation test (now a pure
function test — no timeouts possible).

## Rationale

- The old integration test rendered the full app through a router with
async HTTP mock layers, causing flaky 5000ms timeouts on CI (issue
elastic#248548).
- The new unit tests render components directly with minimal mocks, use
synchronous `fireEvent`, and test validation as pure function calls.

## Coverage mapping

- [Integration → unit test mapping
(gist)](https://gist.github.com/kapral18/b6ccde9cbf84bc18c35fc356861aba50)

## Test Plan

- `node scripts/check_changes.ts` — passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/services/validation/validate_repository.test.ts`
— 24 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/step_one.test.tsx`
— 10 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/components/repository_form/repository_form.test.tsx`
— 14 passed
- `yarn test:jest
x-pack/platform/plugins/private/snapshot_restore/public/application/sections/repository_add/repository_add.test.tsx`
— 1 passed

Assisted with Claude Code using Claude 4.6 Opus

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:version Backport to applied version labels Feature:Snapshot and Restore Elasticsearch snapshots and repositories UI release_note:skip Skip the PR/issue when compiling release notes Team:Kibana Management Dev Tools, Index Management, Upgrade Assistant, ILM, Ingest Node Pipelines, and more t// v9.3.3 v9.4.0

Projects

None yet

4 participants