[7.x] [Enterprise Search] Automatically mock shared logic files (#88494)#88530
Merged
cee-chen merged 1 commit intoelastic:7.xfrom Jan 15, 2021
Merged
[7.x] [Enterprise Search] Automatically mock shared logic files (#88494)#88530cee-chen merged 1 commit intoelastic:7.xfrom
cee-chen merged 1 commit intoelastic:7.xfrom
Conversation
) * Update shared logic mocks to automatically mock their exports * Update FlashMessages to also mock its helper fns * Fix tests that were relying on component exports from shared logic files * Fix broken flash_messages tests - Caused by leaking auto mocks - work around this by importing from files directly and not from index.ts - Also clean up / use new auto mocks (e.g. for kibana) - Convert old instances of useValues mock to setMockValues * [AS] Update AnalyticsLogic test to use new auto mockers + move LogicMounter and destructured mock values to top of describe block * [AS] Update CredentialsLogic + udpate to use new clearFlashMessages helper * [AS] Update documents logic tests * [AS] Update engines logic tests * [AS] Update log retention logic test * [Shared] Update IndexingStatus tests + update to use LogicMounter * [Shared] Update telemetry logic test * [WS] Update AddSourceLogic + update to use new clearFlashMessages helper * [WS] Update groups logic files + update to use new flash message helpers * [WS] Update OverviewLogic test * [WS] Update AddSource component test + consolidate mocks imports * [Shared] Clean up KibanaLogic imports - all jest.mocks come along from the ride when the __mocks__ folder is imported, so HttpLogic is now automatically already mocked * [AS] Update EngineRouter test # Conflicts: # x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source.test.tsx # x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.test.ts # x-pack/plugins/enterprise_search/public/applications/workplace_search/views/content_sources/components/add_source/add_source_logic.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.
Backports the following commits to 7.x: