-
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.
Browse files
Browse the repository at this point in the history
* timeline eql -> 1-Do not default tiebreaker 2-Close EQL setting popover * review I * review focus trap is a trap * no need to mock it for everybody Co-authored-by: Xavier Mouligneau <[email protected]>
- Loading branch information
1 parent
96de13e
commit 231b271
Showing
10 changed files
with
85 additions
and
19 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
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
58 changes: 58 additions & 0 deletions
58
...lugins/security_solution/public/detections/components/rules/eql_query_bar/footer.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,58 @@ | ||
/* | ||
* 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 { mount } from 'enzyme'; | ||
|
||
import { TestProviders } from '../../../../common/mock'; | ||
import { EqlQueryBarFooter } from './footer'; | ||
|
||
jest.mock('../../../../common/lib/kibana', () => { | ||
const originalModule = jest.requireActual('../../../../common/lib/kibana'); | ||
return { | ||
...originalModule, | ||
useKibana: () => ({ | ||
services: { | ||
docLinks: { links: { query: { eql: 'url-eql_doc' } } }, | ||
}, | ||
}), | ||
}; | ||
}); | ||
|
||
describe('EQL footer', () => { | ||
describe('EQL Settings', () => { | ||
beforeEach(() => { | ||
jest.resetAllMocks(); | ||
}); | ||
|
||
it('EQL settings button is enable when popover is NOT open', () => { | ||
const wrapper = mount( | ||
<TestProviders> | ||
<EqlQueryBarFooter errors={[]} onOptionsChange={jest.fn()} /> | ||
</TestProviders> | ||
); | ||
|
||
expect( | ||
wrapper.find(`[data-test-subj="eql-settings-trigger"]`).first().prop('isDisabled') | ||
).toBeFalsy(); | ||
}); | ||
|
||
it('disable EQL settings button when popover is open', () => { | ||
const wrapper = mount( | ||
<TestProviders> | ||
<EqlQueryBarFooter errors={[]} onOptionsChange={jest.fn()} /> | ||
</TestProviders> | ||
); | ||
wrapper.find(`[data-test-subj="eql-settings-trigger"]`).first().simulate('click'); | ||
wrapper.update(); | ||
|
||
expect( | ||
wrapper.find(`[data-test-subj="eql-settings-trigger"]`).first().prop('isDisabled') | ||
).toBeTruthy(); | ||
}); | ||
}); | ||
}); |
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
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