Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix up node tests #1701

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions frontend_tests/node_tests/templates.js
Expand Up @@ -545,6 +545,22 @@ function render(template_name, args) {

}());

(function sidebar_private_message_list() {
var args = {
want_show_more_messages_links: true,
messages: [
{
recipients: "alice,bob"
}
]
};

var html = '';
html += render('sidebar_private_message_list', args);

global.write_handlebars_output("sidebar_private_message_list", html);
}());

(function sidebar_subject_list() {
var args = {
want_show_more_topics_links: true,
Expand Down Expand Up @@ -625,6 +641,8 @@ function render(template_name, args) {
}());

(function stream_sidebar_row() {
global.use_template('stream_privacy'); // partial

var args = {
name: "devel",
color: "red",
Expand Down
1 change: 1 addition & 0 deletions frontend_tests/zjsunit/index.js
Expand Up @@ -39,6 +39,7 @@ files.forEach(function (file) {
global.patch_builtin('setInterval', noop);

console.info('running tests for ' + file.name);
render.init();
require(file.full_name);
namespace.restore();
});
Expand Down
4 changes: 4 additions & 0 deletions frontend_tests/zjsunit/render.js
Expand Up @@ -10,6 +10,10 @@ function template_dir() {
return __dirname + '/../../static/templates/';
}

exports.init = function () {
Handlebars.templates = {};
};

exports.make_sure_all_templates_have_been_compiled = function () {
var dir = template_dir();
var fns = fs.readdirSync(dir).filter(function (fn) {
Expand Down