From 5e611826da5680a5d0156b38e43b019dc2e35837 Mon Sep 17 00:00:00 2001 From: Joshua Pan Date: Mon, 19 Jun 2017 15:32:20 -0700 Subject: [PATCH] node tests: Call settings_bot.set_up() to get initial line coverage. --- frontend_tests/node_tests/settings_bots.js | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/frontend_tests/node_tests/settings_bots.js b/frontend_tests/node_tests/settings_bots.js index bd25ed397d..f0836d0276 100644 --- a/frontend_tests/node_tests/settings_bots.js +++ b/frontend_tests/node_tests/settings_bots.js @@ -2,6 +2,16 @@ set_global("page_params", { realm_uri: "https://chat.example.com", }); +set_global("avatar", {}); + +add_dependencies({ + bot_data: 'js/bot_data.js', + upload_widget: 'js/upload_widget.js', +}); + +set_global('$', global.make_zjquery()); +set_global('document', {}); + var settings_bots = require("js/settings_bots.js"); (function test_generate_zuliprc_uri() { @@ -44,3 +54,20 @@ var settings_bots = require("js/settings_bots.js"); assert.equal(content, expected); }()); + + +(function test_set_up() { + // bunch of stubs + + $.validator = { addMethod: function () {} }; + + $("#get_api_key_box form").ajaxForm = function () {}; + + $("#create_bot_form").validate = function () {}; + + avatar.build_bot_create_widget = function () {}; + avatar.build_bot_edit_widget = function () {}; + + settings_bots.set_up(); +}()); +