-
Notifications
You must be signed in to change notification settings - Fork 8.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SIEM][CASE] Configuration page tests #61093
Conversation
Pinging @elastic/siem (Team:SIEM) |
a734b88
to
bca2bdc
Compare
d03594c
to
418407a
Compare
418407a
to
fcf0836
Compare
@elasticmachine merge upstream |
Please be aware that x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/index.test.tsx is big and Github does not showing it fully. |
x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/index.test.tsx
Outdated
Show resolved
Hide resolved
|
||
beforeEach(() => { | ||
jest.resetAllMocks(); | ||
useCaseConfigureMock.mockImplementation( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In comparison to mock the implementation here, I would mock the return value for useCaseConfigureMock
and useReducer
In this case for example, I would remove Line 74-83, and add a mockReturnValue for useReducer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to avoid mocking the reducer because is a pure function and this is the only way (in my knowledge) I can test the callback functions (setConnectorId
etc).
x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/index.test.tsx
Outdated
Show resolved
Hide resolved
x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/index.test.tsx
Show resolved
Hide resolved
x-pack/legacy/plugins/siem/public/pages/case/components/configure_cases/index.test.tsx
Outdated
Show resolved
Hide resolved
@elasticmachine merge upstream |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, @cnasikas looks good to me!
💚 Build SucceededHistory
To update your PR or re-run it, just comment with: |
* Test ClosureOptionsRadio component * Test ClosureOptions component * Test ConnectorsDropdown component * Test Connectors * Test FieldMappingRow * Test FieldMapping * Create utils functions and refactor to be able to test * Test Mapping * Improve tests * Test ConfigureCases * Refactor tests * Fix flacky tests * Remove snapshots * Refactor tests * Test button * Test reducer * Move test * Better structure Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Test ClosureOptionsRadio component * Test ClosureOptions component * Test ConnectorsDropdown component * Test Connectors * Test FieldMappingRow * Test FieldMapping * Create utils functions and refactor to be able to test * Test Mapping * Improve tests * Test ConfigureCases * Refactor tests * Fix flacky tests * Remove snapshots * Refactor tests * Test button * Test reducer * Move test * Better structure Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Test ClosureOptionsRadio component * Test ClosureOptions component * Test ConnectorsDropdown component * Test Connectors * Test FieldMappingRow * Test FieldMapping * Create utils functions and refactor to be able to test * Test Mapping * Improve tests * Test ConfigureCases * Refactor tests * Fix flacky tests * Remove snapshots * Refactor tests * Test button * Test reducer * Move test * Better structure Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
* Test ClosureOptionsRadio component * Test ClosureOptions component * Test ConnectorsDropdown component * Test Connectors * Test FieldMappingRow * Test FieldMapping * Create utils functions and refactor to be able to test * Test Mapping * Improve tests * Test ConfigureCases * Refactor tests * Fix flacky tests * Remove snapshots * Refactor tests * Test button * Test reducer * Move test * Better structure Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Pinging @elastic/security-solution (Team: SecuritySolution) |
Summary
Test for the configuration page (#61092).
Checklist
Delete any items that are not applicable to this PR.
For maintainers