-
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
[Security Solution][lists] Adds tests for exception lists and items part 2 #74815
[Security Solution][lists] Adds tests for exception lists and items part 2 #74815
Conversation
// create an exception list | ||
await supertest | ||
.post(EXCEPTION_LIST_URL) | ||
.set('kbn-xsrf', 'true') | ||
.send(getCreateExceptionListMinimalSchemaMock()) | ||
.expect(200); |
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.
These simple blocks get repeated a bit -- 19 for this one. From a readability perspective it may be worth breaking this out as a helper, thoughts? It's nice having the whole block when needing to modify tests, but these seem like pretty simple operations to encapsulate for readability.
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.
Yeah, was debating that. Turning that into a one-liner.
It's boilerplatey and we might with a follow up with doing that here. I won't do it with this one as we have other PR's that are about to go through where we will need these tests in place for some protection against obvious oopsies but down the road I think we should here and probably in detection engine where things repeat.
Appreciate the thoughts.
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.
Checked out, ran tests locally, and code reviewed -- thank you much for filling out these much-needed tests, mocks and helpers here @FrankHassanabad. Feels a lot better going forward with these gaps in coverage filled, and you laid a great foundation to build on as we add features too! LGTM! 👍 🙇♂️ 🎉
Pinging @elastic/siem (Team:SIEM) |
💚 Build SucceededBuild metrics
History
To update your PR or re-run it, just comment with: |
…art 2 (elastic#74815) ## Summary This is the basics of end to end tests, so there could be a lot more, but this ties to cover the basics of the tests. Test with: ```ts node scripts/functional_tests --config x-pack/test/lists_api_integration/security_and_spaces/config.ts ``` Adds these tests for the route counter parts: * create_exception_list_items.ts * create_exception_lists.ts * delete_exception_list_items.ts * delete_exception_lists.ts * find_exception_list_items.ts * find_exception_lists.ts * read_exception_list_items.ts * read_exception_lists.ts * update_exception_list_items.ts * update_exception_lists.ts Fixes a few minor strings, other tests, but no large bugs found with these tests ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
…art 2 (#74815) (#74921) ## Summary This is the basics of end to end tests, so there could be a lot more, but this ties to cover the basics of the tests. Test with: ```ts node scripts/functional_tests --config x-pack/test/lists_api_integration/security_and_spaces/config.ts ``` Adds these tests for the route counter parts: * create_exception_list_items.ts * create_exception_lists.ts * delete_exception_list_items.ts * delete_exception_lists.ts * find_exception_list_items.ts * find_exception_lists.ts * read_exception_list_items.ts * read_exception_lists.ts * update_exception_list_items.ts * update_exception_lists.ts Fixes a few minor strings, other tests, but no large bugs found with these tests ### Checklist - [x] [Unit or functional tests](https://www.elastic.co/guide/en/kibana/master/development-tests.html) were updated or added to match the most common scenarios
* master: (28 commits) [Task manager] Prevents edge case where already running tasks are reschedule every polling interval (elastic#74606) [Security Solution] Fix the status of timelines' bulk actions (elastic#74560) Data plugin: Suggested enhance pattern (elastic#74505) Use jest.useFakeTimers instead of hard coded timeout for tooltip tests. (elastic#74642) [Security Solution][lists] Adds tests for exception lists and items part 2 (elastic#74815) [Security Solution][Resolver] fix presentation role on edgeline (elastic#74869) [Security Solution][Detections] Refactor ML calls for newest ML permissions (elastic#74582) [bin/kibana-plugin] support KP plugins instead (elastic#74604) Reduce number of indexed fields in index pattern saved object (elastic#74817) [reporting] Pass along generic parameters in high-order route handler (elastic#74892) Migrated last pieces of legacy fixture code (elastic#74470) Empty index patterns page re-design (elastic#68819) [babel] coalese some versions to prevent breaking yarn install (elastic#74864) [Dashboard First] Decouple Attribute Service and By Value Embeddables (elastic#74302) Revert "[reporting] Pass along generic parameters in high-order route handler" (elastic#74891) [reporting] Pass along generic parameters in high-order route handler (elastic#74879) [src/dev/build] implement a getBuildNumber() mock (elastic#74881) [Enterprise Search] Add solution-level side navigation (elastic#74705) [DOCS] Canvas docs 7.9 refresh (elastic#74000) [Security Solution][Resolver]Enzyme test related events closing (elastic#74811) ...
…le-buffer-with-update-of-same-id * upstream/master: (37 commits) [Task manager] Prevents edge case where already running tasks are reschedule every polling interval (elastic#74606) [Security Solution] Fix the status of timelines' bulk actions (elastic#74560) Data plugin: Suggested enhance pattern (elastic#74505) Use jest.useFakeTimers instead of hard coded timeout for tooltip tests. (elastic#74642) [Security Solution][lists] Adds tests for exception lists and items part 2 (elastic#74815) [Security Solution][Resolver] fix presentation role on edgeline (elastic#74869) [Security Solution][Detections] Refactor ML calls for newest ML permissions (elastic#74582) [bin/kibana-plugin] support KP plugins instead (elastic#74604) Reduce number of indexed fields in index pattern saved object (elastic#74817) [reporting] Pass along generic parameters in high-order route handler (elastic#74892) Migrated last pieces of legacy fixture code (elastic#74470) Empty index patterns page re-design (elastic#68819) [babel] coalese some versions to prevent breaking yarn install (elastic#74864) [Dashboard First] Decouple Attribute Service and By Value Embeddables (elastic#74302) Revert "[reporting] Pass along generic parameters in high-order route handler" (elastic#74891) [reporting] Pass along generic parameters in high-order route handler (elastic#74879) [src/dev/build] implement a getBuildNumber() mock (elastic#74881) [Enterprise Search] Add solution-level side navigation (elastic#74705) [DOCS] Canvas docs 7.9 refresh (elastic#74000) [Security Solution][Resolver]Enzyme test related events closing (elastic#74811) ...
* upstream/master: (45 commits) [Metrics UI] Fix inventory footer misalignment (elastic#74707) Remove legacy optimizer (elastic#73154) Update design-specific GH code-owners (elastic#74877) skip test Reporting paginates content elastic#74922 [Metrics UI] Add Jest tests for alert previews (elastic#74890) Fixed tooltip (elastic#74074) [Ingest Pipelines] Processor forms for processors A-D (elastic#72849) [Observability] change ingest manager link (elastic#74928) [Task manager] Prevents edge case where already running tasks are reschedule every polling interval (elastic#74606) [Security Solution] Fix the status of timelines' bulk actions (elastic#74560) Data plugin: Suggested enhance pattern (elastic#74505) Use jest.useFakeTimers instead of hard coded timeout for tooltip tests. (elastic#74642) [Security Solution][lists] Adds tests for exception lists and items part 2 (elastic#74815) [Security Solution][Resolver] fix presentation role on edgeline (elastic#74869) [Security Solution][Detections] Refactor ML calls for newest ML permissions (elastic#74582) [bin/kibana-plugin] support KP plugins instead (elastic#74604) Reduce number of indexed fields in index pattern saved object (elastic#74817) [reporting] Pass along generic parameters in high-order route handler (elastic#74892) Migrated last pieces of legacy fixture code (elastic#74470) Empty index patterns page re-design (elastic#68819) ...
Pinging @elastic/security-solution (Team: SecuritySolution) |
Summary
This is the basics of end to end tests, so there could be a lot more, but this ties to cover the basics of the tests.
Test with:
Adds these tests for the route counter parts:
Fixes a few minor strings, other tests, but no large bugs found with these tests
Checklist