diff --git a/x-pack/plugins/security_solution/public/cases/components/case_view/index.test.tsx b/x-pack/plugins/security_solution/public/cases/components/case_view/index.test.tsx
index c64cb2087252..737143c7a3ef 100644
--- a/x-pack/plugins/security_solution/public/cases/components/case_view/index.test.tsx
+++ b/x-pack/plugins/security_solution/public/cases/components/case_view/index.test.tsx
@@ -144,7 +144,7 @@ describe('CaseView ', () => {
jest.spyOn(routeData, 'useLocation').mockReturnValue(mockLocation);
useGetCaseUserActionsMock.mockImplementation(() => defaultUseGetCaseUserActions);
usePostPushToServiceMock.mockImplementation(() => ({ isLoading: false, postPushToService }));
- useConnectorsMock.mockImplementation(() => ({ connectors: connectorsMock, isLoading: false }));
+ useConnectorsMock.mockImplementation(() => ({ connectors: connectorsMock, loading: false }));
useQueryAlertsMock.mockImplementation(() => ({
loading: false,
data: { hits: { hits: alertsHit } },
@@ -705,4 +705,38 @@ describe('CaseView ', () => {
expect(updateObject.updateValue).toEqual({ syncAlerts: false });
});
});
+
+ describe('Callouts', () => {
+ it('it shows the danger callout when a connector has been deleted', async () => {
+ useConnectorsMock.mockImplementation(() => ({ connectors: [], loading: false }));
+ const wrapper = mount(
+
+
+
+
+
+ );
+
+ await waitFor(() => {
+ wrapper.update();
+ expect(wrapper.find('.euiCallOut--danger').first().exists()).toBeTruthy();
+ });
+ });
+
+ it('it does NOT shows the danger callout when connectors are loading', async () => {
+ useConnectorsMock.mockImplementation(() => ({ connectors: [], loading: true }));
+ const wrapper = mount(
+
+
+
+
+
+ );
+
+ await waitFor(() => {
+ wrapper.update();
+ expect(wrapper.find('.euiCallOut--danger').first().exists()).toBeFalsy();
+ });
+ });
+ });
});
diff --git a/x-pack/plugins/security_solution/public/cases/components/case_view/index.tsx b/x-pack/plugins/security_solution/public/cases/components/case_view/index.tsx
index 8d5201e68371..58858fd71481 100644
--- a/x-pack/plugins/security_solution/public/cases/components/case_view/index.tsx
+++ b/x-pack/plugins/security_solution/public/cases/components/case_view/index.tsx
@@ -295,7 +295,7 @@ export const CaseComponent = React.memo(
connectors,
updateCase: handleUpdateCase,
userCanCrud,
- isValidConnector,
+ isValidConnector: isLoadingConnectors ? true : isValidConnector,
alerts,
});