diff --git a/x-pack/plugins/alerts/server/alert_type_registry.test.ts b/x-pack/plugins/alerts/server/alert_type_registry.test.ts index 02c01fe189356..d2588e8f4fb33 100644 --- a/x-pack/plugins/alerts/server/alert_type_registry.test.ts +++ b/x-pack/plugins/alerts/server/alert_type_registry.test.ts @@ -319,9 +319,13 @@ function alertTypeWithVariables(id: string, context: string, state: string): Ale producer: 'alerts', }; + if (!context && !state) return baseAlert; + return { ...baseAlert, - ...(context ? { context: [{ name: context, description: `${id} context` }] } : {}), - ...(state ? { state: [{ name: state, description: `${id} state` }] } : {}), + actionVariables: { + ...(context ? { context: [{ name: context, description: `${id} context` }] } : {}), + ...(state ? { state: [{ name: state, description: `${id} state` }] } : {}), + }, }; }