Skip to content

Commit

Permalink
Add test for kibana footer link
Browse files Browse the repository at this point in the history
  • Loading branch information
mikecote committed Dec 15, 2020
1 parent e9d237f commit 99b5cad
Showing 1 changed file with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,33 @@ export default function emailTest({ getService }: FtrProviderContext) {
});
});

it('should allow customizing the kibana footer link', async () => {
await supertest
.post(`/api/actions/action/${createdActionId}/_execute`)
.set('kbn-xsrf', 'foo')
.send({
params: {
to: ['kibana-action-test@elastic.co'],
subject: 'message with markdown',
message: 'message',
kibanaFooterLink: {
path: '/my/path',
text: 'View my path in Kibana',
},
},
})
.expect(200)
.then((resp: any) => {
const { text, html } = resp.body.data.message;
expect(text).to.eql(
'message\n\n--\n\nThis message was sent by Kibana. [View my path in Kibana](https://localhost:5601/my/path).'
);
expect(html).to.eql(
`<p>message</p>\n<p>--</p>\n<p>This message was sent by Kibana. <a href=\"https://localhost:5601/my/path\">View my path in Kibana</a>.</p>\n`
);
});
});

it('should respond with a 400 Bad Request when creating an email action with an invalid config', async () => {
await supertest
.post('/api/actions/action')
Expand Down

0 comments on commit 99b5cad

Please sign in to comment.