Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const SecretsSchema = schema.object(secretsSchemaProps);
export type ActionParamsType = TypeOf<typeof ParamsSchema>;

const ParamsSchema = schema.object({
message: schema.string(),
message: schema.string({ minLength: 1 }),
});

// action type definition
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,20 @@ export default function slackTest({ getService }: FtrProviderContext) {
expect(result.status).to.eql('ok');
});

it('should handle an empty message error', async () => {
const { body: result } = await supertest
.post(`/api/action/${simulatedActionId}/_execute`)
.set('kbn-xsrf', 'foo')
.send({
params: {
message: '',
},
})
.expect(200);
expect(result.status).to.eql('error');
expect(result.message).to.match(/error validating action params: \[message\]: /);
});

it('should handle a 40x slack error', async () => {
const { body: result } = await supertest
.post(`/api/action/${simulatedActionId}/_execute`)
Expand Down