Skip to content

Commit

Permalink
Fix functional tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Zacqary committed May 17, 2022
1 parent eb1f391 commit ffeb94d
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
2 changes: 2 additions & 0 deletions x-pack/plugins/alerting/server/routes/create_rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,14 @@ const rewriteBodyRes: RewriteResponseCase<SanitizedRule<RuleTypeParams>> = ({
notifyWhen,
muteAll,
mutedInstanceIds,
snoozeSchedule,
executionStatus: { lastExecutionDate, lastDuration, ...executionStatus },
...rest
}) => ({
...rest,
rule_type_id: alertTypeId,
scheduled_task_id: scheduledTaskId,
snooze_schedule: snoozeSchedule,
created_by: createdBy,
updated_by: updatedBy,
created_at: createdAt,
Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/alerting/server/routes/get_rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ const rewriteBodyRes: RewriteResponseCase<SanitizedRule<RuleTypeParams>> = ({
muted_alert_ids: mutedInstanceIds,
mute_all: muteAll,
...(isSnoozedUntil !== undefined ? { is_snoozed_until: isSnoozedUntil } : {}),
// Remove this object spread boolean check after snooze props is added to the public API
...(snoozeSchedule !== undefined ? { snooze_schedule: snoozeSchedule } : {}),
snooze_schedule: snoozeSchedule,
scheduled_task_id: scheduledTaskId,
execution_status: executionStatus && {
...omit(executionStatus, 'lastExecutionDate', 'lastDuration'),
Expand Down
3 changes: 1 addition & 2 deletions x-pack/plugins/alerting/server/routes/lib/rewrite_rule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ export const rewriteRule = ({
mute_all: muteAll,
muted_alert_ids: mutedInstanceIds,
scheduled_task_id: scheduledTaskId,
// Remove this object spread boolean check after snooze props is added to the public API
...(snoozeSchedule != null ? { snooze_schedule: snoozeSchedule } : {}),
snooze_schedule: snoozeSchedule,
...(isSnoozedUntil != null ? { is_snoozed_until: isSnoozedUntil } : {}),
execution_status: executionStatus && {
...omit(executionStatus, 'lastExecutionDate', 'lastDuration'),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ const findTestUtils = (
params: {},
created_by: 'elastic',
scheduled_task_id: match.scheduled_task_id,
snooze_schedule: match.snooze_schedule,
created_at: match.created_at,
updated_at: match.updated_at,
throttle: '1m',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const findTestUtils = (
created_by: null,
api_key_owner: null,
scheduled_task_id: match.scheduled_task_id,
snooze_schedule: match.snooze_schedule,
updated_by: null,
throttle: '1m',
notify_when: 'onThrottleInterval',
Expand Down

0 comments on commit ffeb94d

Please sign in to comment.