Skip to content
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

Merged
merged 20 commits into from
Apr 6, 2020

Conversation

cnasikas
Copy link
Member

@cnasikas cnasikas commented Mar 24, 2020

Summary

Test for the configuration page (#61092).

Checklist

Delete any items that are not applicable to this PR.

For maintainers

@cnasikas cnasikas added release_note:skip Skip the PR/issue when compiling release notes Team:SIEM v7.7.0 v8.0.0 labels Mar 24, 2020
@elasticmachine
Copy link
Contributor

Pinging @elastic/siem (Team:SIEM)

@cnasikas cnasikas force-pushed the configuration_page_tests branch 3 times, most recently from a734b88 to bca2bdc Compare March 28, 2020 16:11
@stephmilovic stephmilovic mentioned this pull request Mar 28, 2020
26 tasks
@cnasikas cnasikas force-pushed the configuration_page_tests branch 5 times, most recently from d03594c to 418407a Compare March 31, 2020 14:04
@cnasikas cnasikas changed the title [SIEM][CASE] Configuration page tests [SIEM][CASE][skip-ci] Configuration page tests Apr 1, 2020
@cnasikas cnasikas force-pushed the configuration_page_tests branch from 418407a to fcf0836 Compare April 2, 2020 14:46
@cnasikas cnasikas changed the title [SIEM][CASE][skip-ci] Configuration page tests [SIEM][CASE] Configuration page tests Apr 2, 2020
@cnasikas
Copy link
Member Author

cnasikas commented Apr 2, 2020

@elasticmachine merge upstream

@cnasikas
Copy link
Member Author

cnasikas commented Apr 3, 2020

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.


beforeEach(() => {
jest.resetAllMocks();
useCaseConfigureMock.mockImplementation(
Copy link
Contributor

@angorayc angorayc Apr 3, 2020

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.

Copy link
Member Author

@cnasikas cnasikas Apr 6, 2020

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).

@cnasikas
Copy link
Member Author

cnasikas commented Apr 6, 2020

@elasticmachine merge upstream

Copy link
Contributor

@angorayc angorayc left a 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!

@kibanamachine
Copy link
Contributor

💚 Build Succeeded

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

@cnasikas cnasikas merged commit d67f222 into elastic:master Apr 6, 2020
@cnasikas cnasikas deleted the configuration_page_tests branch April 6, 2020 17:22
cnasikas added a commit to cnasikas/kibana that referenced this pull request Apr 6, 2020
* 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>
cnasikas added a commit to cnasikas/kibana that referenced this pull request Apr 6, 2020
* 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>
cnasikas added a commit that referenced this pull request Apr 6, 2020
* 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>
cnasikas added a commit that referenced this pull request Apr 6, 2020
* 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>
@MindyRS MindyRS added the Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. label Sep 23, 2021
@elasticmachine
Copy link
Contributor

Pinging @elastic/security-solution (Team: SecuritySolution)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release_note:skip Skip the PR/issue when compiling release notes Team: SecuritySolution Security Solutions Team working on SIEM, Endpoint, Timeline, Resolver, etc. Team:SIEM v7.7.0 v7.8.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants