-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Security Solution] [Bugfix] Fix analyzer missing from alert table (#…
…109183) * fix n test heyyyy * more dead code * fix type things * change field type to const * type fix
- Loading branch information
1 parent
2381522
commit a0bd0af
Showing
7 changed files
with
248 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
x-pack/plugins/timelines/public/components/t_grid/integrated/index.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
/* | ||
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one | ||
* or more contributor license agreements. Licensed under the Elastic License | ||
* 2.0; you may not use this file except in compliance with the Elastic License | ||
* 2.0. | ||
*/ | ||
|
||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { TGridIntegrated, TGridIntegratedProps } from './index'; | ||
import { TestProviders, tGridIntegratedProps } from '../../../mock'; | ||
|
||
const mockId = tGridIntegratedProps.id; | ||
jest.mock('../../../container', () => ({ | ||
useTimelineEvents: () => [ | ||
false, | ||
{ | ||
id: mockId, | ||
inspect: { | ||
dsl: [], | ||
response: [], | ||
}, | ||
totalCount: -1, | ||
pageInfo: { | ||
activePage: 0, | ||
querySize: 0, | ||
}, | ||
events: [], | ||
updatedAt: 0, | ||
}, | ||
], | ||
})); | ||
jest.mock('../helpers', () => { | ||
const original = jest.requireActual('../helpers'); | ||
return { | ||
...original, | ||
getCombinedFilterQuery: () => ({ | ||
bool: { | ||
must: [], | ||
filter: [], | ||
}, | ||
}), | ||
buildCombinedQuery: () => ({ | ||
filterQuery: '{"bool":{"must":[],"filter":[]}}', | ||
}), | ||
}; | ||
}); | ||
const defaultProps: TGridIntegratedProps = tGridIntegratedProps; | ||
describe('integrated t_grid', () => { | ||
const dataTestSubj = 'right-here-dawg'; | ||
it('does not render graphOverlay if graphOverlay=null', () => { | ||
render( | ||
<TestProviders> | ||
<TGridIntegrated {...defaultProps} /> | ||
</TestProviders> | ||
); | ||
expect(screen.queryByTestId(dataTestSubj)).toBeNull(); | ||
}); | ||
it('does render graphOverlay if graphOverlay=React.ReactNode', () => { | ||
render( | ||
<TestProviders> | ||
<TGridIntegrated {...defaultProps} graphOverlay={<span data-test-subj={dataTestSubj} />} /> | ||
</TestProviders> | ||
); | ||
expect(screen.queryByTestId(dataTestSubj)).not.toBeNull(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.