|
|
|
@ -23,9 +23,7 @@ test('create webhook', async (done) => {
@@ -23,9 +23,7 @@ test('create webhook', async (done) => {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('check webhooks', (done) => { |
|
|
|
|
|
|
|
|
|
getAdminResponse('webhooks') |
|
|
|
|
.then((res) => { |
|
|
|
|
getAdminResponse('webhooks').then((res) => { |
|
|
|
|
expect(res.body).toHaveLength(1); |
|
|
|
|
expect(res.body[0].url).toBe(webhook); |
|
|
|
|
expect(res.body[0].events).toStrictEqual(events); |
|
|
|
@ -43,8 +41,7 @@ test('delete webhook', async (done) => {
@@ -43,8 +41,7 @@ test('delete webhook', async (done) => {
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('check that webhook was deleted', (done) => { |
|
|
|
|
getAdminResponse('webhooks') |
|
|
|
|
.then((res) => { |
|
|
|
|
getAdminResponse('webhooks').then((res) => { |
|
|
|
|
expect(res.body).toHaveLength(0); |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
@ -157,3 +154,14 @@ test('check token delete was successful', async (done) => {
@@ -157,3 +154,14 @@ test('check token delete was successful', async (done) => {
|
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
test('send an external integration action using access token expecting failure', async (done) => { |
|
|
|
|
const payload = { |
|
|
|
|
body: 'This is a test external action from the automated integration test', |
|
|
|
|
}; |
|
|
|
|
await request |
|
|
|
|
.post('/api/integrations/chat/action') |
|
|
|
|
.set('Authorization', 'Bearer ' + accessToken) |
|
|
|
|
.send(payload) |
|
|
|
|
.expect(401); |
|
|
|
|
done(); |
|
|
|
|
}); |
|
|
|
|