Skip to content

Commit

Permalink
fix alert tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mshustov committed Aug 1, 2020
1 parent e5e2e7b commit 85e5c27
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions x-pack/plugins/alerts/server/alert_type_registry.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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` }] } : {}),
},
};
}

0 comments on commit 85e5c27

Please sign in to comment.