mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 08:26:11 +00:00
node tests: Add tests for voting_widget.js.
This first commit starts by testing handling of inbound data.
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user