mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
shared-code-webhooks
This commit is contained in:
20
test/common/ops/deleteWebhook.test.js
Normal file
20
test/common/ops/deleteWebhook.test.js
Normal file
@@ -0,0 +1,20 @@
|
||||
import deleteWebhook from '../../../common/script/ops/deleteWebhook';
|
||||
import {
|
||||
generateUser,
|
||||
} from '../../helpers/common.helper';
|
||||
|
||||
describe('shared.ops.deleteWebhook', () => {
|
||||
let user;
|
||||
let req;
|
||||
|
||||
beforeEach(() => {
|
||||
user = generateUser();
|
||||
req = { params: { id: 'some-id' } };
|
||||
});
|
||||
|
||||
it('succeeds', () => {
|
||||
user.preferences.webhooks = { 'some-id': {} };
|
||||
deleteWebhook(user, req);
|
||||
expect(user.preferences.webhooks).to.eql({});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user