mirror of
https://github.com/owncast/owncast.git
synced 2024-11-24 13:50:06 +03:00
Add additional test for testing failure after delete
This commit is contained in:
parent
26522bf26f
commit
f28dd344bd
1 changed files with 110 additions and 102 deletions
|
@ -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) => {
|
|||
});
|
||||
|
||||
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) => {
|
|||
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();
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue