node tests: Use mock_template in stream_edit.

This commit is contained in:
Steve Howell 2021-06-27 13:55:51 +00:00 committed by Steve Howell
parent 3ec190d30b
commit b9e852b1a4
1 changed files with 8 additions and 2 deletions

View File

@ -9,8 +9,6 @@ const {page_params} = require("../zjsunit/zpage_params");
const noop = () => {}; const noop = () => {};
const render_subscription_settings = mock_template("subscription_settings.hbs");
const typeahead_helper = mock_esm("../../static/js/typeahead_helper"); const typeahead_helper = mock_esm("../../static/js/typeahead_helper");
const ui = mock_esm("../../static/js/ui", { const ui = mock_esm("../../static/js/ui", {
get_scroll_element: noop, get_scroll_element: noop,
@ -29,6 +27,9 @@ mock_esm("../../static/js/stream_color", {
set_colorpicker_color: noop, set_colorpicker_color: noop,
}); });
const render_input_pill = mock_template("input_pill.hbs", true);
const render_subscription_settings = mock_template("subscription_settings.hbs");
const peer_data = zrequire("peer_data"); const peer_data = zrequire("peer_data");
const people = zrequire("people"); const people = zrequire("people");
const stream_data = zrequire("stream_data"); const stream_data = zrequire("stream_data");
@ -111,6 +112,11 @@ function test_ui(label, f) {
} }
test_ui("subscriber_pills", ({override}) => { test_ui("subscriber_pills", ({override}) => {
override(render_input_pill, "f", (data, html) => {
assert.equal(typeof data.display_value, "string");
return html;
});
override(stream_edit, "sort_but_pin_current_user_on_top", noop); override(stream_edit, "sort_but_pin_current_user_on_top", noop);
override(render_subscription_settings, "f", () => "subscription_settings"); override(render_subscription_settings, "f", () => "subscription_settings");