mirror of
https://github.com/elastic/kibana.git
synced 2025-04-24 17:59:23 -04:00
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com> Co-authored-by: Christos Nasikas <christos.nasikas@elastic.co>
This commit is contained in:
parent
5cb1b27526
commit
244d949982
4 changed files with 17 additions and 5 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
import { actionTypeRegistryMock } from '../../../triggers_actions_ui/public/application/action_type_registry.mock';
|
||||
import { triggersActionsUiMock } from '../../../triggers_actions_ui/public/mocks';
|
||||
import { getConnectorIcon } from './utils';
|
||||
import { getConnectorIcon, isDeprecatedConnector } from './utils';
|
||||
|
||||
describe('Utils', () => {
|
||||
describe('getConnectorIcon', () => {
|
||||
|
@ -37,4 +37,10 @@ describe('Utils', () => {
|
|||
expect(getConnectorIcon(mockTriggersActionsUiService, '.not-registered')).toBe('');
|
||||
});
|
||||
});
|
||||
|
||||
describe('isDeprecatedConnector', () => {
|
||||
it('returns false if the connector is not defined', () => {
|
||||
expect(isDeprecatedConnector()).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -80,7 +80,7 @@ export const getConnectorIcon = (
|
|||
// TODO: Remove when the applications are certified
|
||||
export const isDeprecatedConnector = (connector?: CaseActionConnector): boolean => {
|
||||
if (connector == null) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ENABLE_NEW_SN_ITSM_CONNECTOR && connector.actionTypeId === '.servicenow') {
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
* 2.0.
|
||||
*/
|
||||
|
||||
import { isRESTApiError, isFieldInvalid } from './helpers';
|
||||
import { isRESTApiError, isFieldInvalid, isDeprecatedConnector } from './helpers';
|
||||
|
||||
describe('helpers', () => {
|
||||
describe('isRESTApiError', () => {
|
||||
|
@ -48,4 +48,10 @@ describe('helpers', () => {
|
|||
expect(isFieldInvalid('description', [])).toBeFalsy();
|
||||
});
|
||||
});
|
||||
|
||||
describe('isDeprecatedConnector', () => {
|
||||
it('returns false if the connector is not defined', () => {
|
||||
expect(isDeprecatedConnector()).toBe(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -28,9 +28,9 @@ export const isFieldInvalid = (
|
|||
): boolean => error !== undefined && error.length > 0 && field != null;
|
||||
|
||||
// TODO: Remove when the applications are certified
|
||||
export const isDeprecatedConnector = (connector: ServiceNowActionConnector): boolean => {
|
||||
export const isDeprecatedConnector = (connector?: ServiceNowActionConnector): boolean => {
|
||||
if (connector == null) {
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!ENABLE_NEW_SN_ITSM_CONNECTOR && connector.actionTypeId === '.servicenow') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue