mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Disable Failing Webhooks (#11966)
* todo comment * add failures field to webhooks and sanitize * implement logic * use update instead of save * specify timeout and maximum number of retries * add tests
This commit is contained in:
@@ -81,6 +81,16 @@ describe('POST /user/webhook', () => {
|
||||
expect(webhook.type).to.eql('taskActivity');
|
||||
});
|
||||
|
||||
it('ignores protected fields', async () => {
|
||||
body.failures = 3;
|
||||
body.lastFailureAt = new Date();
|
||||
|
||||
const webhook = await user.post('/user/webhook', body);
|
||||
|
||||
expect(webhook.failures).to.eql(0);
|
||||
expect(webhook.lastFailureAt).to.eql(undefined);
|
||||
});
|
||||
|
||||
it('successfully adds the webhook', async () => {
|
||||
expect(user.webhooks).to.eql([]);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user