Skip to content

Commit

Permalink
Add Node test for emoji list template
Browse files Browse the repository at this point in the history
  • Loading branch information
blablacio committed Mar 21, 2016
1 parent 310c0f5 commit e4e563d
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions frontend_tests/node_tests/templates.js
Expand Up @@ -728,6 +728,30 @@ function render(template_name, args) {

}());

(function admin_emoji_list() {
global.use_template('admin_emoji_list');
var args = {
emoji: [
{
"name": "MouseFace",
"url": "http://emojipedia-us.s3.amazonaws.com/cache/46/7f/467fe69069c408e07517621f263ea9b5.png"
}
]
};

var html = '';
html += '<tbody id="admin_emoji_table">';
html += render('admin_emoji_list', args);
html += '</tbody>';

global.write_test_output('admin_emoji_list.handlebars', html);

var emoji_name = $(html).find('#admin_emoji_table tr.emoji_row:first span.emoji_name');
var emoji_url = $(html).find('#admin_emoji_table tr.emoji_row:first span.emoji_url img');
assert.equal(emoji_name.text(), 'MouseFace');
assert.equal(emoji_url.attr('src'), 'MouseFace');
}());

// By the end of this test, we should have compiled all our templates. Ideally,
// we will also have exercised them to some degree, but that's a little trickier
// to enforce.
Expand Down

0 comments on commit e4e563d

Please sign in to comment.