-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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 Solutions][Detection Engine] Adds e2e and unit tests for PR #89947 #89973
Conversation
.send() | ||
.expect(200); | ||
expect(body).to.eql({ | ||
index_mapping_outdated: null, |
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.
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.
@@ -15,5 +15,3 @@ export enum ROLES { | |||
platform_engineer = 'platform_engineer', | |||
detections_admin = 'detections_admin', | |||
} | |||
|
|||
export type RolesType = keyof typeof ROLES; |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: I get that these are script folders, but the tests and imports cleaned up when I did the NodeJS index barrel rolls here.
default: | ||
break; | ||
return assertUnreachable(role); |
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.
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.
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.
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