mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[React@18] Fix remaining unit tests (#207195)
This commit is contained in:
parent
939c9fb71e
commit
5766467359
3 changed files with 6 additions and 9 deletions
|
@ -61,9 +61,10 @@ describe('When on the trusted applications page', () => {
|
|||
|
||||
it('should search using expected exception item fields', async () => {
|
||||
const expectedFilterString = parseQueryFilterToKQL('fooFooFoo', SEARCHABLE_FIELDS);
|
||||
const { findAllByTestId } = render();
|
||||
const { getAllByTestId } = render();
|
||||
|
||||
await waitFor(async () => {
|
||||
await expect(findAllByTestId('trustedAppsListPage-card')).resolves.toHaveLength(10);
|
||||
expect(getAllByTestId('trustedAppsListPage-card')).toHaveLength(10);
|
||||
});
|
||||
|
||||
apiMocks.responseProvider.exceptionsFind.mockClear();
|
||||
|
|
|
@ -20,9 +20,10 @@ jest.mock('../../../../sourcerer/containers');
|
|||
jest.mock('../../open_timeline/use_timeline_status');
|
||||
jest.mock('react-redux', () => {
|
||||
const origin = jest.requireActual('react-redux');
|
||||
const mockDispatch = jest.fn();
|
||||
return {
|
||||
...origin,
|
||||
useDispatch: jest.fn(),
|
||||
useDispatch: jest.fn(() => mockDispatch),
|
||||
};
|
||||
});
|
||||
jest.mock('react-router-dom', () => {
|
||||
|
|
|
@ -88,12 +88,7 @@ export const useTimelineTypes = ({
|
|||
|
||||
const onFilterClicked = useCallback(
|
||||
(tabId: TimelineType, tabStyle: TimelineTabsStyle) => {
|
||||
setTimelineTypes((prevTimelineTypes) => {
|
||||
if (prevTimelineTypes !== tabId) {
|
||||
setTimelineTypes(tabId);
|
||||
}
|
||||
return prevTimelineTypes;
|
||||
});
|
||||
setTimelineTypes(tabId);
|
||||
},
|
||||
[setTimelineTypes]
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue