mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-15 05:37:22 +01:00
remove BETA comment and fix tests
This commit is contained in:
@@ -1,23 +1,22 @@
|
||||
import { generateUser } from '../../../../helpers/api-integration/v3';
|
||||
|
||||
describe('GET /user/webhook', () => {
|
||||
let user, webhooks;
|
||||
let user;
|
||||
|
||||
beforeEach(async () => {
|
||||
user = await generateUser();
|
||||
|
||||
webhooks = [];
|
||||
webhooks.push(await user.post('/user/webhook', {
|
||||
await user.post('/user/webhook', {
|
||||
url: 'http://some-url.com',
|
||||
label: 'Label',
|
||||
enabled: true,
|
||||
type: 'taskActivity',
|
||||
options: { created: true, scored: true },
|
||||
}));
|
||||
webhooks.push(await user.post('/user/webhook', {
|
||||
});
|
||||
await user.post('/user/webhook', {
|
||||
url: 'http://some-other-url.com',
|
||||
enabled: false,
|
||||
}));
|
||||
});
|
||||
|
||||
await user.sync();
|
||||
});
|
||||
@@ -25,9 +24,10 @@ describe('GET /user/webhook', () => {
|
||||
it('returns users webhooks', async () => {
|
||||
let response = await user.get('/user/webhook');
|
||||
|
||||
// updatedAt times don't match for some reason, so need to omit those from comparison
|
||||
let omitUpdatedAt = a => a.map(v => _.omit(v, 'updatedAt'));
|
||||
|
||||
expect(omitUpdatedAt(response)).to.eql(omitUpdatedAt(webhooks));
|
||||
expect(response).to.eql(user.webhooks.map(w => {
|
||||
w.createdAt = w.createdAt.toISOString();
|
||||
w.updatedAt = w.updatedAt.toISOString();
|
||||
return w;
|
||||
}));
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user