Skip to content

Commit

Permalink
Fix tests with remaining rule types
Browse files Browse the repository at this point in the history
  • Loading branch information
madirey committed Sep 14, 2021
1 parent 12a2921 commit 653b608
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion x-pack/plugins/security_solution/common/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ export const EQL_RULE_TYPE_ID = `${RULE_TYPE_PREFIX}.eqlRule` as const;
export const INDICATOR_RULE_TYPE_ID = `${RULE_TYPE_PREFIX}.indicatorRule` as const;
export const ML_RULE_TYPE_ID = `${RULE_TYPE_PREFIX}.mlRule` as const;
export const QUERY_RULE_TYPE_ID = `${RULE_TYPE_PREFIX}.queryRule` as const;
export const SAVED_QUERY_RULE_TYPE_ID = `${RULE_TYPE_PREFIX}.savedQueryRule` as const;
export const THRESHOLD_RULE_TYPE_ID = `${RULE_TYPE_PREFIX}.thresholdRule` as const;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,19 @@

import { getFilter } from './find_rules';
import {
EQL_RULE_TYPE_ID,
INDICATOR_RULE_TYPE_ID,
ML_RULE_TYPE_ID,
QUERY_RULE_TYPE_ID,
THRESHOLD_RULE_TYPE_ID,
SIGNALS_ID,
} from '../../../../common/constants';

const allAlertTypeIds = `(alert.attributes.alertTypeId: ${ML_RULE_TYPE_ID}
const allAlertTypeIds = `(alert.attributes.alertTypeId: ${EQL_RULE_TYPE_ID}
OR alert.attributes.alertTypeId: ${ML_RULE_TYPE_ID}
OR alert.attributes.alertTypeId: ${QUERY_RULE_TYPE_ID}
OR alert.attributes.alertTypeId: ${INDICATOR_RULE_TYPE_ID})`.replace(/[\n\r]/g, '');
OR alert.attributes.alertTypeId: ${INDICATOR_RULE_TYPE_ID}
OR alert.attributes.alertTypeId: ${THRESHOLD_RULE_TYPE_ID})`.replace(/[\n\r]/g, '');

describe('find_rules', () => {
const fullFilterTestCases: Array<[boolean, string]> = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ import {
INDICATOR_RULE_TYPE_ID,
ML_RULE_TYPE_ID,
QUERY_RULE_TYPE_ID,
EQL_RULE_TYPE_ID,
THRESHOLD_RULE_TYPE_ID,
} from '../../../../common/constants';

const nonEqlLanguages = t.keyof({ kuery: null, lucene: null });
Expand Down Expand Up @@ -206,12 +208,11 @@ export const notifyWhen = t.union([

export const allRuleTypes = t.union([
t.literal(SIGNALS_ID),
// t.literal(EQL_RULE_TYPE_ID),
t.literal(EQL_RULE_TYPE_ID),
t.literal(ML_RULE_TYPE_ID),
t.literal(QUERY_RULE_TYPE_ID),
// t.literal(SAVED_QUERY_RULE_TYPE_ID),
t.literal(INDICATOR_RULE_TYPE_ID),
// t.literal(THRESHOLD_RULE_TYPE_ID),
t.literal(THRESHOLD_RULE_TYPE_ID),
]);
export type AllRuleTypes = t.TypeOf<typeof allRuleTypes>;

Expand Down

0 comments on commit 653b608

Please sign in to comment.