mirror of
https://github.com/zulip/zulip.git
synced 2025-11-03 05:23:35 +00:00
js: Convert static/js/page_params.js to ES6 module.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
bb1b2048bd
commit
38ffd47b90
@@ -6,10 +6,9 @@ const _ = require("lodash");
|
||||
|
||||
const {set_global, zrequire} = require("../zjsunit/namespace");
|
||||
const {run_test} = require("../zjsunit/test");
|
||||
const {page_params} = require("../zjsunit/zpage_params");
|
||||
|
||||
let page_params = set_global("page_params", {
|
||||
realm_push_notifications_enabled: false,
|
||||
});
|
||||
page_params.realm_push_notifications_enabled = false;
|
||||
|
||||
const muting = zrequire("muting");
|
||||
|
||||
@@ -47,19 +46,13 @@ function assert_zero_counts(counts) {
|
||||
}
|
||||
|
||||
function test_notifiable_count(home_unread_messages, expected_notifiable_count) {
|
||||
page_params = set_global("page_params", {
|
||||
desktop_icon_count_display: 1,
|
||||
});
|
||||
page_params.desktop_icon_count_display = 1;
|
||||
let notifiable_counts = unread.get_notifiable_count();
|
||||
assert.deepEqual(notifiable_counts, home_unread_messages);
|
||||
page_params = set_global("page_params", {
|
||||
desktop_icon_count_display: 2,
|
||||
});
|
||||
page_params.desktop_icon_count_display = 2;
|
||||
notifiable_counts = unread.get_notifiable_count();
|
||||
assert.deepEqual(notifiable_counts, expected_notifiable_count);
|
||||
page_params = set_global("page_params", {
|
||||
desktop_icon_count_display: 3,
|
||||
});
|
||||
page_params.desktop_icon_count_display = 3;
|
||||
notifiable_counts = unread.get_notifiable_count();
|
||||
assert.deepEqual(notifiable_counts, 0);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user