mirror of https://github.com/zulip/zulip.git
Move stream_member_list_entry() code in templates.js
(imported from commit 8cca602597a3277d5e80bc1b314cd3fb16ea013c)
This commit is contained in:
parent
2faf29408a
commit
ac57c3c16b
|
@ -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 = '<table>';
|
||||
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: {
|
||||
|
|
Loading…
Reference in New Issue