[Security Solutions][Detection Engine] Adds e2e and unit tests for PR #89947 #89973
[Security Solutions][Detection Engine] Adds e2e and unit tests for PR #89947 #89973FrankHassanabad merged 4 commits intoelastic:masterfrom
Conversation
| .send() | ||
| .expect(200); | ||
| expect(body).to.eql({ | ||
| index_mapping_outdated: null, |
There was a problem hiding this comment.
NOTE: I think this index_mapping_outdated: null is returned intentionally for when the user does not have correct permissions to read if the index mapping exists or not. It exists here in a few other tests.
| detections_admin = 'detections_admin', | ||
| } | ||
|
|
||
| export type RolesType = keyof typeof ROLES; |
There was a problem hiding this comment.
NOTE: removed as I directly use the ROLES below now and this enables me to use an exhaustive switch.
|
|
||
| import * as t1AnalystUser from './detections_user.json'; | ||
| import * as t1AnalystRole from './detections_role.json'; | ||
| export { t1AnalystUser, t1AnalystRole }; |
There was a problem hiding this comment.
NOTE: I get that these are script folders, but the tests and imports cleaned up when I did the NodeJS index barrel rolls here.
| return postRoleAndUser(ROLES.reader, readerRole, readerUser, securityService); | ||
| default: | ||
| break; | ||
| return assertUnreachable(role); |
There was a problem hiding this comment.
NOTE: Using this and changing the enum above gives us exhaustive switches where when someone adds a new role type such as ROLES.reader (which was missing I noticed), they are forced to add it to this function as well.
dhurley14
left a comment
There was a problem hiding this comment.
Thanks for the cleanup and the additional tests LGTM!
|
@elasticmachine merge upstream |
💚 Build SucceededMetrics [docs]
History
To update your PR or re-run it, just comment with: |
…lastic#89947 (elastic#89973) ## Summary Adds e2e and unit tests for PR: elastic#89947 * Adds e2e tests for create_index * Adds e2e tests for get_privileges * Adds unit test for use_privilege_user * Adds exhaustive switch for the roles in the e2e tests * Adds some typescript barrel rolls for the .json scripts to make TypeScript a bit more readable when doing imports * Fixes some of the types that were not matched up with the recent privilege endpoint ### 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
…lastic#89947 (elastic#89973) ## Summary Adds e2e and unit tests for PR: elastic#89947 * Adds e2e tests for create_index * Adds e2e tests for get_privileges * Adds unit test for use_privilege_user * Adds exhaustive switch for the roles in the e2e tests * Adds some typescript barrel rolls for the .json scripts to make TypeScript a bit more readable when doing imports * Fixes some of the types that were not matched up with the recent privilege endpoint ### 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
…for PR #89947 (#89973) (#90091) * [Security Solutions][Detection Engine] Adds e2e and unit tests for PR #89947 (#89973) ## Summary Adds e2e and unit tests for PR: #89947 * Adds e2e tests for create_index * Adds e2e tests for get_privileges * Adds unit test for use_privilege_user * Adds exhaustive switch for the roles in the e2e tests * Adds some typescript barrel rolls for the .json scripts to make TypeScript a bit more readable when doing imports * Fixes some of the types that were not matched up with the recent privilege endpoint ### 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 * Fixes the backport for test to work correctly as the messages are different * Fixes one permission change issue between versions
… for PR #89947 (#89973) (#90092) * [Security Solutions][Detection Engine] Adds e2e and unit tests for PR #89947 (#89973) ## Summary Adds e2e and unit tests for PR: #89947 * Adds e2e tests for create_index * Adds e2e tests for get_privileges * Adds unit test for use_privilege_user * Adds exhaustive switch for the roles in the e2e tests * Adds some typescript barrel rolls for the .json scripts to make TypeScript a bit more readable when doing imports * Fixes some of the types that were not matched up with the recent privilege endpoint ### 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 * Updated to work with the right messages * Fixes permissions that are slightly different
Summary
Adds e2e and unit tests for PR:
#89947
Checklist