summaryrefslogtreecommitdiffstats
path: root/webapp/tests
diff options
context:
space:
mode:
authorPoornima <mpoornima@users.noreply.github.com>2017-02-27 00:18:20 +0530
committerJoram Wilander <jwawilander@gmail.com>2017-02-26 13:48:20 -0500
commit19b753467d37209f2227567637e60138d05dd405 (patch)
tree163ba0878c02267ecbbcb288e11d23e30ec9c8eb /webapp/tests
parentc0bb6f99f89259f6728856ace23d5dd505494b26 (diff)
downloadchat-19b753467d37209f2227567637e60138d05dd405.tar.gz
chat-19b753467d37209f2227567637e60138d05dd405.tar.bz2
chat-19b753467d37209f2227567637e60138d05dd405.zip
Adding edit of incoming webhook (#5272)
Adding edit of outgoing webhook Fixing spelling of error Fixing style Changing from PUT to POST for updates Fixing test failures due to merge
Diffstat (limited to 'webapp/tests')
-rw-r--r--webapp/tests/client_hooks.test.jsx48
1 files changed, 46 insertions, 2 deletions
diff --git a/webapp/tests/client_hooks.test.jsx b/webapp/tests/client_hooks.test.jsx
index 8d09802a9..841d87b7a 100644
--- a/webapp/tests/client_hooks.test.jsx
+++ b/webapp/tests/client_hooks.test.jsx
@@ -22,7 +22,29 @@ describe('Client.Hooks', function() {
done(new Error('hooks not enabled'));
},
function(err) {
- assert.equal(err.id, 'api.webhook.create_incoming.disabled.app_errror');
+ assert.equal(err.id, 'api.webhook.create_incoming.disabled.app_error');
+ done();
+ }
+ );
+ });
+ });
+
+ it('updateIncomingHook', function(done) {
+ TestHelper.initBasic(() => {
+ TestHelper.basicClient().enableLogErrorsToConsole(false); // Disabling since this unit test causes an error
+
+ var hook = {};
+ hook.channel_id = TestHelper.basicChannel().id;
+ hook.description = 'desc';
+ hook.display_name = 'Unit Test';
+
+ TestHelper.basicClient().updateIncomingHook(
+ hook,
+ function() {
+ done(new Error('hooks not enabled'));
+ },
+ function(err) {
+ assert.equal(err.id, 'api.webhook.update_incoming.disabled.app_error');
done();
}
);
@@ -38,7 +60,7 @@ describe('Client.Hooks', function() {
done(new Error('hooks not enabled'));
},
function(err) {
- assert.equal(err.id, 'api.webhook.delete_incoming.disabled.app_errror');
+ assert.equal(err.id, 'api.webhook.delete_incoming.disabled.app_error');
done();
}
);
@@ -128,5 +150,27 @@ describe('Client.Hooks', function() {
);
});
});
+
+ it('updateOutgoingHook', function(done) {
+ TestHelper.initBasic(() => {
+ TestHelper.basicClient().enableLogErrorsToConsole(false); // Disabling since this unit test causes an error
+
+ var hook = {};
+ hook.channel_id = TestHelper.basicChannel().id;
+ hook.description = 'desc';
+ hook.display_name = 'Unit Test';
+
+ TestHelper.basicClient().updateOutgoingHook(
+ hook,
+ function() {
+ done(new Error('hooks not enabled'));
+ },
+ function(err) {
+ assert.equal(err.id, 'api.webhook.update_outgoing.disabled.app_error');
+ done();
+ }
+ );
+ });
+ });
});