node tests: Add tests for voting_widget.js.

This first commit starts by testing handling of
inbound data.
This commit is contained in:
Steve Howell
2018-07-02 14:48:23 +00:00
committed by showell
parent 456c8fed83
commit 1fdfe11e8b
2 changed files with 81 additions and 2 deletions

View File

@@ -2,7 +2,7 @@ var voting_widget = (function () {
var exports = {};
var poll_data_holder = function (is_my_poll, question) {
exports.poll_data_holder = function (is_my_poll, question) {
// This object just holds data for a poll, although it
// works closely with the widget's concept of how data
// should be represented for rendering, plus how the
@@ -147,7 +147,7 @@ exports.activate = function (opts) {
}
var is_my_poll = people.is_my_user_id(opts.message.sender_id);
var poll_data = poll_data_holder(is_my_poll, question);
var poll_data = exports.poll_data_holder(is_my_poll, question);
function render() {
var html = templates.render('poll-widget');