[Security Solution][Case] Show error banner after loading connectors (#90134)
This commit is contained in:
parent
7a3279768d
commit
24bf256bb0
|
@ -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(
|
||||
<TestProviders>
|
||||
<Router history={mockHistory}>
|
||||
<CaseComponent {...caseProps} />
|
||||
</Router>
|
||||
</TestProviders>
|
||||
);
|
||||
|
||||
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(
|
||||
<TestProviders>
|
||||
<Router history={mockHistory}>
|
||||
<CaseComponent {...caseProps} />
|
||||
</Router>
|
||||
</TestProviders>
|
||||
);
|
||||
|
||||
await waitFor(() => {
|
||||
wrapper.update();
|
||||
expect(wrapper.find('.euiCallOut--danger').first().exists()).toBeFalsy();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -295,7 +295,7 @@ export const CaseComponent = React.memo<CaseProps>(
|
|||
connectors,
|
||||
updateCase: handleUpdateCase,
|
||||
userCanCrud,
|
||||
isValidConnector,
|
||||
isValidConnector: isLoadingConnectors ? true : isValidConnector,
|
||||
alerts,
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue