Skip to content

Commit f11a6ae

Browse files
committed
PR feedback pt3
1 parent 39187c0 commit f11a6ae

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

x-pack/plugins/actions/server/__jest__/validate_action_type_config.test.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,3 +65,25 @@ test('should validate and throw error when actionTypeConfig is invalid', () => {
6565
`"actionTypeConfig invalid: child \\"param1\\" fails because [\\"param1\\" is required]"`
6666
);
6767
});
68+
69+
test('should not return values when actionTypeConfig is invalid', () => {
70+
expect(() =>
71+
validateActionTypeConfig(
72+
{
73+
id: 'my-action-type',
74+
name: 'My action type',
75+
validate: {
76+
config: Joi.object()
77+
.keys({
78+
param1: Joi.number().required(),
79+
})
80+
.required(),
81+
},
82+
async executor() {},
83+
},
84+
{ param1: 'my secret value' }
85+
)
86+
).toThrowErrorMatchingInlineSnapshot(
87+
`"actionTypeConfig invalid: child \\"param1\\" fails because [\\"param1\\" must be a number]"`
88+
);
89+
});

0 commit comments

Comments
 (0)