Skip to content

Commit 85e5c27

Browse files
committed
fix alert tests
1 parent e5e2e7b commit 85e5c27

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

x-pack/plugins/alerts/server/alert_type_registry.test.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -319,9 +319,13 @@ function alertTypeWithVariables(id: string, context: string, state: string): Ale
319319
producer: 'alerts',
320320
};
321321

322+
if (!context && !state) return baseAlert;
323+
322324
return {
323325
...baseAlert,
324-
...(context ? { context: [{ name: context, description: `${id} context` }] } : {}),
325-
...(state ? { state: [{ name: state, description: `${id} state` }] } : {}),
326+
actionVariables: {
327+
...(context ? { context: [{ name: context, description: `${id} context` }] } : {}),
328+
...(state ? { state: [{ name: state, description: `${id} state` }] } : {}),
329+
},
326330
};
327331
}

0 commit comments

Comments
 (0)