-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Infrastructure UI] Flyout metadata tests #153581
[Infrastructure UI] Flyout metadata tests #153581
Conversation
🤖 GitHub commentsExpand to view the GitHub comments
Just comment with:
|
@@ -26,7 +26,7 @@ export interface TabProps { | |||
node: HostNodeRow; | |||
} | |||
|
|||
const Metadata = ({ node, currentTimeRange }: TabProps) => { | |||
export const Metadata = ({ node, currentTimeRange }: TabProps) => { |
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.
Exported for testing purposes
@@ -0,0 +1,40 @@ | |||
/* |
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.
I added this wrapper to have it shared for all components and make it easier to test the components without wrapping them in each test - we can expand it with core services mocks if needed for other tests.
jest.mock('../../../../../../containers/metrics_source'); | ||
jest.mock('../../../../metric_detail/hooks/use_metadata'); | ||
|
||
const metadataProps: TabProps = { |
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.
I keep the whole object to match the type restriction
Pinging @elastic/infra-monitoring-ui (Team:Infra Monitoring UI) |
1cb8a4d
to
4a04953
Compare
💔 Build FailedFailed CI Steps
Test Failures
Metrics [docs]Module Count
Public APIs missing comments
Any counts in public APIs
Async chunks
Public APIs missing exports
Page load bundle
Saved Objects .kibana field count
Unknown metric groupsAPI count
async chunk count
ESLint disabled in files
ESLint disabled line counts
miscellaneous assets size
References to deprecated APIs
Total ESLint disabled count
History
To update your PR or re-run it, just comment with: |
Summary
Related to #150893
This PR adds tests for the flyout feature. Most of the changes are adding test ids and helpers and the actual tests you can see in metadata.test.tsx and hosts view functional test
Functional Test
Added a check for open/close of the flyout and metadata tab title visibility - this can be expanded when the filtering functionality is added
Component Test
As we have many cases based on the metadata response I added a separate test for the
metadata
component. Usually, we don't have this approach but some cases like the error/no data case are hard to cover only with a functional test.