[Snapshot & Restore] Remove axios dependency in tests#128614
Merged
sabarasaba merged 9 commits intoelastic:mainfrom Apr 4, 2022
Merged
[Snapshot & Restore] Remove axios dependency in tests#128614sabarasaba merged 9 commits intoelastic:mainfrom
axios dependency in tests#128614sabarasaba merged 9 commits intoelastic:mainfrom
Conversation
This was referenced Mar 28, 2022
sabarasaba
commented
Mar 29, 2022
| initialEntries: ['/add_policy'], | ||
| componentRoutePath: '/add_policy', | ||
| }, | ||
| doMountAsync: true, |
Member
Author
There was a problem hiding this comment.
This was previously mounting the component on the wrong route, but since we had a wildcard api mock with sinon things were working anyway.
sabarasaba
commented
Mar 29, 2022
| const { find, actions } = testBed; | ||
| const updatedSnapshot = { ...snapshot1, state: 'IN_PROGRESS' }; | ||
| httpRequestsMockHelpers.setGetSnapshotResponse(updatedSnapshot); | ||
| const updatedSnapshot = { ...snapshot2, state: 'IN_PROGRESS' }; |
Member
Author
There was a problem hiding this comment.
Was previously using the wrong snapshot mock but since the api call had a wildcard it was working fine.
Contributor
|
Pinging @elastic/platform-deployment-management (Team:Deployment Management) |
Member
Author
|
@elasticmachine merge upstream |
alisonelizabeth
approved these changes
Mar 31, 2022
Contributor
alisonelizabeth
left a comment
There was a problem hiding this comment.
Great work @sabarasaba! LGTM.
| export const WithAppDependencies = (Comp: any) => (props: any) => | ||
| ( | ||
| export const WithAppDependencies = (Comp: any, httpSetup?: HttpSetup) => (props: any) => { | ||
| // We need to optionally setup the httpService since some cit helpers (such as snapshot_list.helpers) |
Contributor
There was a problem hiding this comment.
👍 thanks for adding this comment!
Member
Author
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: cc @sabarasaba |
sabarasaba
added a commit
to sabarasaba/kibana
that referenced
this pull request
Apr 4, 2022
* wip: start refactoring test helpers * commit using @elastic.co * Fix more tests * Finish off refactoring all cits * Add docs * Fix linter issues * Fix ts issues (cherry picked from commit fa74030) # Conflicts: # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_add.helpers.ts # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts
sabarasaba
added a commit
that referenced
this pull request
Apr 4, 2022
…29343) * wip: start refactoring test helpers * commit using @elastic.co * Fix more tests * Finish off refactoring all cits * Add docs * Fix linter issues * Fix ts issues (cherry picked from commit fa74030) # Conflicts: # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/home.helpers.ts # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_add.helpers.ts # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/policy_edit.helpers.ts # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_add.helpers.ts # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/repository_edit.helpers.ts # x-pack/plugins/snapshot_restore/__jest__/client_integration/helpers/restore_snapshot.helpers.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Partially addresses #127966
Summary
In order to upgrade the axios dependency in kibana(see: #111655) we need to switch the tests from this app to use HttpSetup mock instead of axios + sinon server mock, which is technically incorrect but axios just happened to have methods signature similar to HttpSetup.