-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
[Cases] Get connector's information from actionsTypeRegistry
#101279
Conversation
b339ec9
to
43be09a
Compare
Pinging @elastic/security-solution (Team: SecuritySolution) |
Pinging @elastic/security-threat-hunting (Team:Threat Hunting) |
@@ -160,6 +163,10 @@ describe('CaseView ', () => { | |||
pushCaseToExternalService, | |||
})); | |||
useConnectorsMock.mockImplementation(() => ({ connectors: connectorsMock, loading: false })); | |||
useKibanaMock().services.triggersActionsUi.actionTypeRegistry.get = jest.fn().mockReturnValue({ |
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.
Will the tests throughout this PR fail if get
returns undefined
? I'm just wondering if it's sufficient to jest.mock('../../common/lib/kibana')
Seems like we do this in some places: https:/elastic/kibana/pull/101279/files#diff-94a9922e9734d8791131f05c1124fd6197bdceb756e6bc2770191639b905e169R85
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 see what you mean! It is not sufficient because of the way the mock is being created (triggersActionsUiMock.createStart()
in x-pack/plugins/cases/public/common/lib/kibana/kibana_react.mock.ts
). The actionTypeRegistry
is not mocked so when the flyout access the actionTypeRegistry
to get the connector type you will get an error that the type is not registered.
x-pack/plugins/cases/public/components/configure_cases/mapping.tsx
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
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.
@elasticmachine merge upstream |
…e actionsTypeRegistry exposed by the triggersActionsUi plugin setup contract
7424a65
to
f62728a
Compare
@cnasikas I'm not sure why the core team was automatically added as reviewers. From what I can tell, our team isn't a |
x-pack/plugins/cases/public/common/lib/kibana/kibana_react.mock.ts
Outdated
Show resolved
Hide resolved
You are right. This PR was based on another PR (the RBAC PR) that touched some of your files. The PR got merged and I switched the base to master. It seems that your team stayed as a reviewer. Sorry for the trouble! |
💚 Build SucceededMetrics [docs]Module Count
Public APIs missing comments
Async chunks
Public APIs missing exports
Page load bundle
History
To update your PR or re-run it, just comment with: cc @cnasikas |
…) (#101570) Co-authored-by: Yuliia Naumenko <[email protected]> Co-authored-by: Yuliia Naumenko <[email protected]>
Summary
Current PR resolves the second part of the scope defined for the #95871. Specifically:
actionsTypeRegistry
which is exposed by thetriggersActionsUi
plugin setup contract.Adaptation: #100442
Checklist
Delete any items that are not applicable to this PR.
For maintainers