-
Notifications
You must be signed in to change notification settings - Fork 8.5k
[IndexPatterns] Clean up StubIndexPattern
#108555
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
mattkime
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Huge improvement. 🚀
|
Pinging @elastic/kibana-app-services (Team:AppServices) |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
justinkambic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exploratory view change LGTM!
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
|
@elasticmachine merge upstream |
kertal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just tests affected so didn't checkout and test, Code review KibanaApp owned code
|
@elasticmachine merge upstream |
💚 Build Succeeded
Metrics [docs]
History
To update your PR or re-run it, just comment with: |
💚 Backport successful
This backport PR will be merged automatically after passing CI. |
Co-authored-by: Anton Dosov <anton.dosov@elastic.co>
Summary
Close #78519
This pr cleans up a bit of unit tests code that uses
StubIndexPatternexported from the data plugin.What was done:
IndexPatterninstance.logstashindex pattern that is used in a bunch of Discover's and some other tests. All the/fixtures/logstash_fields.jswere moved near the stub and I a bit restructured it for this.commonand inpubliccode. The difference is thatpubliccode uses a realpublicfield formats registry by default, whereascommonuse a dummy mock of it.How to use:
Existing stub
You can use
jest.spyOnto track usage and provide mock implementation instead of creating a custom index pattern as a shortcut. Don't forget to reset mocks in your tests.Custom stub