[Security Solution][Cypress] - Update cypress tests to undo a util change that was redundant (#130722)

Update cypress tests to undo a util change that was redundant.
This commit is contained in:
Yara Tercero 2022-04-27 10:07:25 -07:00 committed by GitHub
parent f149a17871
commit f5f035645e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 11 deletions

View file

@ -11,7 +11,7 @@ import { getNewRule } from '../../objects/rule';
import { ALERTS_COUNT, EMPTY_ALERT_TABLE, NUMBER_OF_ALERTS } from '../../screens/alerts';
import { addExceptionFromFirstAlert, goToClosedAlerts, goToOpenedAlerts } from '../../tasks/alerts';
import { createCustomRule } from '../../tasks/api_calls/rules';
import { createCustomRuleEnabled } from '../../tasks/api_calls/rules';
import { goToRuleDetails } from '../../tasks/alerts_detection_rules';
import { waitForAlertsToPopulate } from '../../tasks/create_new_rule';
import { esArchiverLoad, esArchiverUnload } from '../../tasks/es_archiver';
@ -39,11 +39,10 @@ describe('Adds rule exception', () => {
beforeEach(() => {
deleteAlertsAndRules();
createCustomRule(
createCustomRuleEnabled(
{ ...getNewRule(), customQuery: 'agent.name:*', index: ['exceptions*'] },
'rule_testing',
'5s',
true
'1s'
);
visitWithoutDateRange(DETECTIONS_RULE_MANAGEMENT_URL);
goToRuleDetails();

View file

@ -7,12 +7,7 @@
import { CustomRule, ThreatIndicatorRule } from '../../objects/rule';
export const createCustomRule = (
rule: CustomRule,
ruleId = 'rule_testing',
interval = '100m',
enabled = false
) =>
export const createCustomRule = (rule: CustomRule, ruleId = 'rule_testing', interval = '100m') =>
cy.request({
method: 'POST',
url: 'api/detection_engine/rules',
@ -28,7 +23,7 @@ export const createCustomRule = (
index: rule.index,
query: rule.customQuery,
language: 'kuery',
enabled,
enabled: false,
exceptions_list: rule.exceptionLists ?? [],
},
headers: { 'kbn-xsrf': 'cypress-creds' },