diff --git a/x-pack/plugins/alerting/server/alert/alert.test.ts b/x-pack/plugins/alerting/server/alert/alert.test.ts index 8e4807e6203c6..4db40294aa978 100644 --- a/x-pack/plugins/alerting/server/alert/alert.test.ts +++ b/x-pack/plugins/alerting/server/alert/alert.test.ts @@ -344,6 +344,7 @@ describe('updateLastScheduledActions()', () => { group: 'default', }, flappingHistory: [], + maintenanceWindowIds: [], }, }); }); @@ -357,6 +358,7 @@ describe('updateLastScheduledActions()', () => { state: {}, meta: { flappingHistory: [], + maintenanceWindowIds: [], uuid: expect.any(String), lastScheduledActions: { date: new Date().toISOString(), @@ -373,6 +375,7 @@ describe('updateLastScheduledActions()', () => { const alert = new Alert('1', { meta: { flappingHistory: [], + maintenanceWindowIds: [], lastScheduledActions: { date: new Date(), group: 'default', @@ -387,6 +390,7 @@ describe('updateLastScheduledActions()', () => { state: {}, meta: { flappingHistory: [], + maintenanceWindowIds: [], uuid: expect.any(String), lastScheduledActions: { date: new Date().toISOString(), @@ -484,6 +488,7 @@ describe('toJSON', () => { group: 'default', }, flappingHistory: [false, true], + maintenanceWindowIds: [], flapping: false, pendingRecoveredCount: 2, }, @@ -548,6 +553,7 @@ describe('toRaw', () => { meta: { flappingHistory: [false, true, true], flapping: false, + maintenanceWindowIds: [], uuid: expect.any(String), }, }); @@ -570,6 +576,7 @@ describe('setFlappingHistory', () => { "flappingHistory": Array [ false, ], + "maintenanceWindowIds": Array [], "uuid": Any, }, "state": Object {}, @@ -602,6 +609,7 @@ describe('setFlapping', () => { "meta": Object { "flapping": false, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "uuid": Any, }, "state": Object {}, diff --git a/x-pack/plugins/alerting/server/lib/get_alerts_for_notification.test.ts b/x-pack/plugins/alerting/server/lib/get_alerts_for_notification.test.ts index 9da07f4707d45..2cb820fabed39 100644 --- a/x-pack/plugins/alerting/server/lib/get_alerts_for_notification.test.ts +++ b/x-pack/plugins/alerting/server/lib/get_alerts_for_notification.test.ts @@ -38,6 +38,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": true, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": "uuid-1", }, @@ -51,6 +52,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": true, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": "uuid-1", }, @@ -60,6 +62,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": false, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": "uuid-2", }, @@ -105,6 +108,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": true, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 1, "uuid": Any, }, @@ -123,18 +127,19 @@ describe('getAlertsForNotification', () => { ] `); expect(alertsWithAnyUUID(currentActiveAlerts)).toMatchInlineSnapshot(` - Object { - "3": Object { - "meta": Object { - "flapping": true, - "flappingHistory": Array [], - "pendingRecoveredCount": 1, - "uuid": Any, - }, - "state": Object {}, - }, - } - `); + Object { + "3": Object { + "meta": Object { + "flapping": true, + "flappingHistory": Array [], + "maintenanceWindowIds": Array [], + "pendingRecoveredCount": 1, + "uuid": Any, + }, + "state": Object {}, + }, + } + `); expect(Object.values(currentActiveAlerts).map((a) => a.getScheduledActionOptions())) .toMatchInlineSnapshot(` Array [ @@ -151,6 +156,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": true, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": Any, }, @@ -160,6 +166,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": false, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "uuid": Any, }, "state": Object {}, @@ -172,6 +179,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": true, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": Any, }, @@ -181,6 +189,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": false, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "uuid": Any, }, "state": Object {}, @@ -231,6 +240,7 @@ describe('getAlertsForNotification', () => { false, true, ], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": Any, }, @@ -244,6 +254,7 @@ describe('getAlertsForNotification', () => { false, true, ], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": Any, }, @@ -257,6 +268,7 @@ describe('getAlertsForNotification', () => { false, true, ], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": Any, }, @@ -274,6 +286,7 @@ describe('getAlertsForNotification', () => { false, true, ], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": Any, }, @@ -287,6 +300,7 @@ describe('getAlertsForNotification', () => { false, true, ], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": Any, }, @@ -300,6 +314,7 @@ describe('getAlertsForNotification', () => { false, true, ], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": Any, }, @@ -345,6 +360,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": true, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 1, "uuid": Any, }, @@ -372,6 +388,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": true, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": Any, }, @@ -381,6 +398,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": false, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "uuid": Any, }, "state": Object {}, @@ -393,6 +411,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": true, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "pendingRecoveredCount": 0, "uuid": Any, }, @@ -402,6 +421,7 @@ describe('getAlertsForNotification', () => { "meta": Object { "flapping": false, "flappingHistory": Array [], + "maintenanceWindowIds": Array [], "uuid": Any, }, "state": Object {},