mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 23:13:25 +00:00
Move stream_member_list_entry() code in templates.js
(imported from commit 8cca602597a3277d5e80bc1b314cd3fb16ea013c)
This commit is contained in:
@@ -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() {
|
(function admin_streams_list() {
|
||||||
var html = '<table>';
|
var html = '<table>';
|
||||||
var streams = ['devel', 'trac', 'zulip'];
|
var streams = ['devel', 'trac', 'zulip'];
|
||||||
@@ -421,6 +395,32 @@ function render(template_name, args) {
|
|||||||
assert.equal(li.attr('data-name'), 'lunch');
|
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() {
|
(function stream_sidebar_actions() {
|
||||||
var args = {
|
var args = {
|
||||||
stream: {
|
stream: {
|
||||||
|
|||||||
Reference in New Issue
Block a user