Skip to content

Commit ba8c8ac

Browse files
committed
applied feedback and fixed failing cypress issue
1 parent 92b3fee commit ba8c8ac

2 files changed

Lines changed: 13 additions & 6 deletions

File tree

x-pack/plugins/security_solution/cypress/screens/alerts_detection_rules.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ export const RULE_CHECKBOX = '.euiTableRow .euiCheckbox__input';
4747

4848
export const RULE_NAME = '[data-test-subj="ruleName"]';
4949

50-
export const RULE_SWITCH = '[data-test-subj="rule-switch"]';
50+
export const RULE_SWITCH = '[data-test-subj="ruleSwitch"]';
5151

52-
export const RULE_SWITCH_LOADER = '[data-test-subj="rule-switch-loader"]';
52+
export const RULE_SWITCH_LOADER = '[data-test-subj="ruleSwitchLoader"]';
5353

5454
export const RULES_TABLE = '[data-test-subj="rules-table"]';
5555

x-pack/plugins/security_solution/server/lib/detection_engine/routes/rules/validate.test.ts

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,18 @@ describe('validate', () => {
110110
total: 0,
111111
};
112112
const [validated, errors] = transformValidateFindAlerts(findResult, []);
113-
expect(validated).toEqual({
113+
const expected: {
114+
page: number;
115+
perPage: number;
116+
total: number;
117+
data: Array<Partial<RulesSchema>>;
118+
} | null = {
114119
data: [ruleOutput()],
115120
page: 1,
116121
perPage: 0,
117122
total: 0,
118-
});
123+
};
124+
expect(validated).toEqual(expected);
119125
expect(errors).toEqual(null);
120126
});
121127

@@ -160,13 +166,14 @@ describe('validate', () => {
160166
const ruleStatus = getFindResultStatus();
161167
const ruleAlert = getResult();
162168
const validatedOrError = transformValidateBulkError('rule-1', ruleAlert, null, ruleStatus);
163-
expect(validatedOrError).toEqual({
169+
const expected: RulesSchema = {
164170
...ruleOutput(),
165171
status: 'succeeded',
166172
status_date: '2020-02-18T15:26:49.783Z',
167173
last_success_at: '2020-02-18T15:26:49.783Z',
168174
last_success_message: 'succeeded',
169-
});
175+
};
176+
expect(validatedOrError).toEqual(expected);
170177
});
171178

172179
test('it should return error object if "alert" is not expected alert type', () => {

0 commit comments

Comments
 (0)