From ac57c3c16b1695df4fb48e509ffa1f48601b1e89 Mon Sep 17 00:00:00 2001 From: Steve Howell Date: Sat, 1 Feb 2014 11:12:28 -0500 Subject: [PATCH] Move stream_member_list_entry() code in templates.js (imported from commit 8cca602597a3277d5e80bc1b314cd3fb16ea013c) --- zerver/tests/frontend/node/templates.js | 52 ++++++++++++------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/zerver/tests/frontend/node/templates.js b/zerver/tests/frontend/node/templates.js index c7e04a7dd0..cb8170e1ba 100644 --- a/zerver/tests/frontend/node/templates.js +++ b/zerver/tests/frontend/node/templates.js @@ -74,32 +74,6 @@ function render(template_name, args) { }); }()); -(function stream_member_list_entry() { - var everyone_items = ["subscriber-name", "subscriber-email"]; - var admin_items = ["remove-subscriber-button"]; - - // First, as non-admin. - var html = render('stream_member_list_entry', - {name: "King Hamlet", email: "hamlet@zulip.com"}); - _.each(everyone_items, function (item) { - assert.equal($(html).find("." + item).length, 1); - }); - _.each(admin_items, function (item) { - assert.equal($(html).find("." + item).length, 0); - }); - - // Now, as admin. - html = render('stream_member_list_entry', - {name: "King Hamlet", email: "hamlet@zulip.com", - displaying_for_admin: true}); - _.each(everyone_items, function (item) { - assert.equal($(html).find("." + item).length, 1); - }); - _.each(admin_items, function (item) { - assert.equal($(html).find("." + item).length, 1); - }); -}()); - (function admin_streams_list() { var html = ''; var streams = ['devel', 'trac', 'zulip']; @@ -421,6 +395,32 @@ function render(template_name, args) { assert.equal(li.attr('data-name'), 'lunch'); }()); +(function stream_member_list_entry() { + var everyone_items = ["subscriber-name", "subscriber-email"]; + var admin_items = ["remove-subscriber-button"]; + + // First, as non-admin. + var html = render('stream_member_list_entry', + {name: "King Hamlet", email: "hamlet@zulip.com"}); + _.each(everyone_items, function (item) { + assert.equal($(html).find("." + item).length, 1); + }); + _.each(admin_items, function (item) { + assert.equal($(html).find("." + item).length, 0); + }); + + // Now, as admin. + html = render('stream_member_list_entry', + {name: "King Hamlet", email: "hamlet@zulip.com", + displaying_for_admin: true}); + _.each(everyone_items, function (item) { + assert.equal($(html).find("." + item).length, 1); + }); + _.each(admin_items, function (item) { + assert.equal($(html).find("." + item).length, 1); + }); +}()); + (function stream_sidebar_actions() { var args = { stream: {