mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
[Security Solution][Exceptions] - Fix bug displaying filepath warning for non endpoint exception items (#151570)
## Summary Addresses https://github.com/elastic/kibana/issues/145970 Fix bug displaying filepath warning for non endpoint exception items
This commit is contained in:
parent
250dcffcda
commit
7a03aeaed9
2 changed files with 39 additions and 1 deletions
|
@ -523,6 +523,44 @@ describe('BuilderEntryItem', () => {
|
|||
expect(wrapper.find('[data-test-subj="exceptionBuilderEntryFieldWildcard"]').text()).toEqual(
|
||||
'1234*'
|
||||
);
|
||||
// doesnt show warning label for non endpoint exception items
|
||||
expect(
|
||||
wrapper.find('[data-test-subj="valuesAutocompleteWildcardLabel"] .euiFormHelpText')
|
||||
).toHaveLength(0);
|
||||
});
|
||||
|
||||
test('it does not render matches filepath warning message for rule default list item', () => {
|
||||
wrapper = mount(
|
||||
<BuilderEntryItem
|
||||
autocompleteService={autocompleteStartMock}
|
||||
entry={{
|
||||
correspondingKeywordField: undefined,
|
||||
entryIndex: 0,
|
||||
field: getField('@tags'),
|
||||
id: '123',
|
||||
nested: undefined,
|
||||
operator: matchesOperator,
|
||||
parent: undefined,
|
||||
value: '1234*',
|
||||
}}
|
||||
httpService={mockKibanaHttpService}
|
||||
indexPattern={{
|
||||
fields,
|
||||
id: '1234',
|
||||
title: 'logstash-*',
|
||||
}}
|
||||
listType="rule_default"
|
||||
onChange={jest.fn()}
|
||||
setErrorsExist={jest.fn()}
|
||||
setWarningsExist={jest.fn()}
|
||||
showLabel={false}
|
||||
/>
|
||||
);
|
||||
|
||||
// doesnt show warning label for non endpoint exception items
|
||||
expect(
|
||||
wrapper.find('[data-test-subj="valuesAutocompleteWildcardLabel"] .euiFormHelpText')
|
||||
).toHaveLength(0);
|
||||
});
|
||||
|
||||
test('it renders field values correctly when operator is "doesNotMatchOperator"', () => {
|
||||
|
|
|
@ -404,7 +404,7 @@ export const BuilderEntryItem: React.FC<EntryItemProps> = ({
|
|||
case OperatorTypeEnum.WILDCARD:
|
||||
const wildcardValue = typeof entry.value === 'string' ? entry.value : undefined;
|
||||
let actualWarning: React.ReactNode | string | undefined;
|
||||
if (listType !== 'detection') {
|
||||
if (listType !== 'detection' && listType !== 'rule_default') {
|
||||
let os: OperatingSystem = OperatingSystem.WINDOWS;
|
||||
if (osTypes) {
|
||||
[os] = osTypes as OperatingSystem[];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue