Allow update webhook label with an empty string (#11479)

* Allow update webhook label with an empty string

* Adding comment to explain the label check
This commit is contained in:
Evelyn Stender
2019-11-16 16:52:27 +00:00
committed by Matteo Pagliazzi
parent eca1d8501c
commit 5f0672f3a6
2 changed files with 22 additions and 1 deletions

View File

@@ -63,6 +63,26 @@ describe('PUT /user/webhook/:id', () => {
expect(webhook.options).to.eql(options);
});
it('updates a webhook with empty label', async () => {
const url = 'http://a-new-url.com';
const type = 'groupChatReceived';
const label = '';
const options = { groupId: generateUUID() };
await user.put(`/user/webhook/${webhookToUpdate.id}`, {
url, type, options, label,
});
await user.sync();
const webhook = user.webhooks.find(hook => webhookToUpdate.id === hook.id);
expect(webhook.url).to.equal(url);
expect(webhook.label).to.equal(label);
expect(webhook.type).to.equal(type);
expect(webhook.options).to.eql(options);
});
it('returns the updated webhook', async () => {
const url = 'http://a-new-url.com';
const type = 'groupChatReceived';