PR feedback pt3

This commit is contained in:
Mike Cote 2019-06-17 08:38:20 -04:00
parent 39187c0ce6
commit f11a6aeb06

View file

@ -65,3 +65,25 @@ test('should validate and throw error when actionTypeConfig is invalid', () => {
`"actionTypeConfig invalid: child \\"param1\\" fails because [\\"param1\\" is required]"`
);
});
test('should not return values when actionTypeConfig is invalid', () => {
expect(() =>
validateActionTypeConfig(
{
id: 'my-action-type',
name: 'My action type',
validate: {
config: Joi.object()
.keys({
param1: Joi.number().required(),
})
.required(),
},
async executor() {},
},
{ param1: 'my secret value' }
)
).toThrowErrorMatchingInlineSnapshot(
`"actionTypeConfig invalid: child \\"param1\\" fails because [\\"param1\\" must be a number]"`
);
});