tests: Export rewired variables.

Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
Anders Kaseorg 2024-11-08 01:26:51 -08:00 committed by Tim Abbott
parent a37aab19ed
commit db2723036f
5 changed files with 10 additions and 5 deletions

View File

@ -87,7 +87,8 @@ function set_next_start_time(current_time: number, typing_started_wait_period: n
state.next_send_start_time = current_time + typing_started_wait_period; state.next_send_start_time = current_time + typing_started_wait_period;
} }
function actually_ping_server( // Exported for tests
export function actually_ping_server(
worker: TypingStatusWorker, worker: TypingStatusWorker,
recipient: Recipient, recipient: Recipient,
current_time: number, current_time: number,

View File

@ -60,7 +60,8 @@ export function get_recipient_label(message?: ComposeClosedMessage): string {
return ""; return "";
} }
function update_reply_button_state(disable = false): void { // Exported for tests
export function update_reply_button_state(disable = false): void {
$(".compose_reply_button").attr("disabled", disable ? "disabled" : null); $(".compose_reply_button").attr("disabled", disable ? "disabled" : null);
if (disable) { if (disable) {
$("#compose_buttons .compose-reply-button-wrapper").attr( $("#compose_buttons .compose-reply-button-wrapper").attr(

View File

@ -475,7 +475,8 @@ function is_recipient_large_topic(): boolean {
return topic_participant_count_more_than_threshold(stream_id, compose_state.topic()); return topic_participant_count_more_than_threshold(stream_id, compose_state.topic());
} }
function wildcard_mention_policy_authorizes_user(): boolean { // Exported for tests
export function wildcard_mention_policy_authorizes_user(): boolean {
if ( if (
realm.realm_wildcard_mention_policy === realm.realm_wildcard_mention_policy ===
settings_config.wildcard_mention_policy_values.by_everyone.code settings_config.wildcard_mention_policy_values.by_everyone.code

View File

@ -389,7 +389,8 @@ function reset_searchbox(clear = false): void {
} }
} }
function exit_search(opts: {keep_search_narrow_open: boolean}): void { // Exported for tests
export function exit_search(opts: {keep_search_narrow_open: boolean}): void {
const filter = narrow_state.filter(); const filter = narrow_state.filter();
if (!filter || filter.is_common_narrow()) { if (!filter || filter.is_common_narrow()) {
// for common narrows, we change the UI (and don't redirect) // for common narrows, we change the UI (and don't redirect)

View File

@ -1054,7 +1054,8 @@ export function register_save_discard_widget_handlers(
); );
} }
function initialize_group_setting_widgets(): void { // Exported for tests
export function initialize_group_setting_widgets(): void {
const realm_group_permission_settings = Object.entries( const realm_group_permission_settings = Object.entries(
realm.server_supported_permission_settings.realm, realm.server_supported_permission_settings.realm,
); );