-
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
[ML] Adds Jest tests for the rules editor flyout components #21636
[ML] Adds Jest tests for the rules editor flyout components #21636
Conversation
Pinging @elastic/ml-ui |
💔 Build Failed |
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
jest.mock('../../services/job_service', () => ({ | ||
mlJobService: { | ||
getJob: () => { | ||
return { |
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.
total nit but this return object could be a separate JSON file which we import. resonates with the idea James' mentioned that something like a mock for mlJobService
could be made reusable for other tests.
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.
Yes, as some of these mocked functions start needing to be reused I agree it would be a good idea to move things like test job configs into separate files. We'd need a wide range of job configs to cover all the things we're testing - here for example I want a detector with no partitioning fields and a single rule.
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 added a nitpick comment about possibly putting mock objects in separate json files.
daf7e8d
to
d94f24c
Compare
💚 Build Succeeded |
Adds Jest tests for the components on the rule editor flyout, as used in the Anomalies table, created in #20339.
Tests added for components:
Addresses the first item in #20831