Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
patrykkopycinski committed Jul 3, 2020
1 parent 1810185 commit 888234c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ import { Overview } from './index';

jest.mock('../../common/lib/kibana');
jest.mock('../../common/containers/source');
jest.mock('../../common/containers/use_global_time', () => ({
useGlobalTime: jest
.fn()
.mockReturnValue({ from: 0, isInitializing: false, to: 0, setQuery: jest.fn() }),
}));

// Test will fail because we will to need to mock some core services to make the test work
// For now let's forget about SiemSearchBar and QueryBar
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
*/

import { EuiFlexGroup, EuiFlexItem, EuiSpacer } from '@elastic/eui';
import React, { useState, useMemo } from 'react';
import React, { useCallback, useState, useMemo } from 'react';
import { connect, ConnectedProps } from 'react-redux';
import { StickyContainer } from 'react-sticky';
import { Query, Filter } from 'src/plugins/data/public';
Expand Down Expand Up @@ -60,10 +60,10 @@ const OverviewComponent: React.FC<PropsFromRedux> = ({
);

const [dismissMessage, setDismissMessage] = useState<boolean>(hasDismissEndpointNoticeMessage);
const dismissEndpointNotice = () => {
const dismissEndpointNotice = useCallback(() => {
setDismissMessage(true);
addMessage('management', 'dismissEndpointNotice');
};
}, [addMessage]);

return (
<>
Expand Down

0 comments on commit 888234c

Please sign in to comment.