Skip to content

Commit b143474

Browse files
committed
Fix test types
1 parent 1779e52 commit b143474

3 files changed

Lines changed: 17 additions & 8 deletions

File tree

x-pack/platform/test/api_integration_deployment_agnostic/apis/alerting_v2/bulk_create_alert_action.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,14 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
2626
roleAuthc = await samlAuth.createM2mApiKeyWithRoleScope('admin');
2727

2828
// Create alert events for two different group hashes
29-
const alertEvent1 = createAlertEvent({ group_hash: 'group-1', episode_id: 'episode-1' });
30-
const alertEvent2 = createAlertEvent({ group_hash: 'group-2', episode_id: 'episode-2' });
29+
const alertEvent1 = createAlertEvent({
30+
group_hash: 'group-1',
31+
episode: { id: 'episode-1', status: 'active' },
32+
});
33+
const alertEvent2 = createAlertEvent({
34+
group_hash: 'group-2',
35+
episode: { id: 'episode-2', status: 'active' },
36+
});
3137

3238
await Promise.all([
3339
esClient.index({

x-pack/platform/test/api_integration_deployment_agnostic/apis/alerting_v2/create_alert_action.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
3030

3131
olderAlertEvent = createAlertEvent({
3232
group_hash: 'test-group-hash',
33-
episode_id: 'episode-1',
33+
episode: { id: 'episode-1', status: 'active' },
3434
'@timestamp': '2024-01-01T00:00:00.000Z',
3535
});
3636
alertEvent = createAlertEvent({
3737
group_hash: 'test-group-hash',
38-
episode_id: 'episode-2',
38+
episode: { id: 'episode-2', status: 'active' },
3939
'@timestamp': '2024-01-02T00:00:00.000Z',
4040
});
4141

@@ -104,7 +104,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
104104
expect(action).to.be.ok();
105105
expect(action!.group_hash).to.be('test-group-hash');
106106
expect(action!.action_type).to.be('ack');
107-
expect(action!.episode_id).to.be(alertEvent.episode_id);
107+
expect(action!.episode_id).to.be(alertEvent.episode?.id);
108108
expect(action!.rule_id).to.be(alertEvent.rule.id);
109109
expect(action!.last_series_event_timestamp).to.be(alertEvent['@timestamp']);
110110
});
@@ -122,7 +122,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
122122
expect(action).to.be.ok();
123123
expect(action!.group_hash).to.be('test-group-hash');
124124
expect(action!.action_type).to.be('unack');
125-
expect(action!.episode_id).to.be(alertEvent.episode_id);
125+
expect(action!.episode_id).to.be(alertEvent.episode?.id);
126126
});
127127

128128
it('should return 204 for tag action with tags and write action document', async () => {
@@ -272,7 +272,7 @@ export default function ({ getService }: DeploymentAgnosticFtrProviderContext) {
272272
expect(action).to.be.ok();
273273
expect(action!.group_hash).to.be('test-group-hash');
274274
expect(action!.action_type).to.be('ack');
275-
expect(action!.episode_id).to.be(olderAlertEvent.episode_id);
275+
expect(action!.episode_id).to.be(olderAlertEvent.episode?.id);
276276
expect(action!.last_series_event_timestamp).to.be(olderAlertEvent['@timestamp']);
277277
});
278278
});

x-pack/platform/test/api_integration_deployment_agnostic/apis/alerting_v2/fixtures/alert_event.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ export const createAlertEvent = (overrides?: Partial<AlertEvent>): AlertEvent =>
1919
status: 'breached',
2020
source: 'test-source',
2121
type: 'alert',
22-
episode_id: 'test-episode-id',
22+
episode: {
23+
id: 'test-episode-id',
24+
status: 'active',
25+
},
2326
...overrides,
2427
});

0 commit comments

Comments
 (0)