tests: Improve templates.compose_private_stream_alert() test.

I assert that the stream_name gets properly placed into the HTML.
This commit is contained in:
Steve Howell 2017-11-27 08:34:47 -08:00 committed by Tim Abbott
parent 8f190e0746
commit e74118e730
1 changed files with 6 additions and 1 deletions

View File

@ -520,10 +520,15 @@ function render(template_name, args) {
(function compose_private_stream_alert() {
var args = {
name: 'Demark',
stream_name: 'Denmark',
invite_only: true,
};
var html = render('compose_private_stream_alert', args);
assert($(html).hasClass('compose_private_stream_alert'));
var actual_text = $(html).text();
var expected_text = 'translated: Warning: Denmark is a private stream.';
assert(actual_text.indexOf(expected_text) >= 1);
global.write_handlebars_output("compose_stream_alert", html);
}());