zulip/static/js
Abhijeet Prasad Bodas 206fe1ef3b node tests: Introduce message_store.create_mock_message() helper.
Previously, it was tedious to create actual message
objects in message_store for use in node tests.
This was mainly because, `add_message_metadata`
in message_store has many dependencies and
validation checks. Since it was difficult to create
actual message objects, many tests just mocked
the `message_store.get()` method to return the desired
message.

This commit adds a new helper method (`create_mock_message`)
to message_store, for use in node tests. This just stores
the object passed to it in the `stores_messages` map,
without any validation. We do not add any
default fields to the message object before saving
it from this helper, because doing so would decrease
the utility of this helper, and, if a test
depends on some field having a particular value,
then it would be better to just pass the field: value
pair from the test itself, for readability, rather
than relying on the helper to add the field for us.

This helper allows us to write deeper tests.

This commit also replaces some instances of mocking
`message_store.get()` to use this new helper method.
2021-03-18 15:55:39 -07:00
..
analytics js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
billing js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
bundles js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
portico js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
stats js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
types eslint: Remove and prohibit unused eslint-disable directives. 2020-12-10 18:08:45 -08:00
activity.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
admin.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
alert_words.js js: Convert static/js/alert_words.js to ES6 module. 2021-02-10 10:27:14 -08:00
alert_words_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
archive.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
attachments_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
avatar.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
blueslip.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
blueslip_stacktrace.ts eslint: Fix unicorn/error-message. 2020-12-22 16:14:28 -08:00
bot_data.js node tests: Add test() wrapper to bot_data. 2021-03-14 08:11:25 -04:00
buddy_data.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
buddy_list.js node tests: Use clean BuddyList instance in tests. 2021-03-18 16:37:20 -04:00
channel.js minor: Fix mention of success handler in error wrapper. 2021-03-18 10:09:22 -07:00
click_handlers.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
color_data.js js: Convert static/js/color_data.js to ES6 module. 2021-02-28 14:23:00 -08:00
colorspace.js js: Convert static/js/colorspace.js to ES6 module. 2021-02-10 10:27:14 -08:00
common.js zjsunit: Do not run $(...) automatically. 2021-03-13 11:48:50 -05:00
components.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
compose.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
compose_actions.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
compose_fade.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
compose_pm_pill.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
compose_state.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
compose_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
composebox_typeahead.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
condense.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
confirm_dialog.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
copy_and_paste.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
csrf.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
css_variables.js styles: Use range context queries to eliminate *_max variables. 2021-02-05 09:23:59 -08:00
debug.js eslint: Fix unicorn/no-array-for-each. 2021-01-25 14:53:19 -08:00
desktop_integration.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
drafts.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
dropdown_list_widget.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
echo.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
emoji_picker.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
emojisets.js eslint: Fix unicorn/prefer-add-event-listener. 2020-10-07 16:00:33 -07:00
favicon.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
feature_flags.js js: Convert static/js/feature_flags.js to ES6 module with modzulator. 2021-02-10 10:27:14 -08:00
feedback_widget.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
fetch_status.js js: Convert static/js/message_scroll.js to ES6 module. 2021-02-28 14:23:00 -08:00
filter.js js: Convert static/js/unread.js to ES6 module. 2021-03-02 17:06:35 -08:00
floating_recipient_bar.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
fold_dict.ts typescript: Enable strictNullChecks. 2020-07-28 11:01:35 -07:00
gear_menu.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
global.d.ts js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
hash_util.js hash_util: Convert object characterToBeReplaced object to map. 2021-03-18 15:07:17 -07:00
hashchange.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
hbs.d.ts
hotkey.js recent_topics: Directly pass jquery element instead of event object. 2021-03-16 14:54:22 -07:00
hotspots.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
huddle_data.js node tests: Add test() wrapper for suggestions. 2021-03-12 15:29:23 -05:00
i18n.js docs: Add comment links to i18n documentation. 2020-09-18 11:44:04 -07:00
info_overlay.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
input_pill.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
invite.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
keydown_util.js js: Convert static/js/keydown_util.js to ES6 module. 2021-02-28 14:23:00 -08:00
lazy_set.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
lightbox.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
lightbox_canvas.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
list_cursor.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
list_util.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
list_widget.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
loading.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
local_message.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
localstorage.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
markdown.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
markdown_config.js js: Convert static/js/hash_util.js to ES6 module. 2021-02-28 14:23:00 -08:00
message_edit.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
message_edit_history.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
message_events.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
message_fetch.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
message_flags.js refactor: Extract update message flags POST call. 2021-03-18 15:55:31 -07:00
message_list.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
message_list_data.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
message_list_view.js refractor: Created set_calculated_message_container_variables function. 2021-03-17 17:21:42 -07:00
message_live_update.js js: Convert static/js/message_list.js to ES6 module. 2021-03-02 17:06:35 -08:00
message_scroll.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
message_store.js node tests: Introduce message_store.create_mock_message() helper. 2021-03-18 15:55:39 -07:00
message_util.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
message_view_header.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
message_viewport.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
muting.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
muting_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
narrow.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
narrow_state.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
navigate.js js: Convert static/js/unread_ops.js to ES6 module. 2021-03-02 17:06:35 -08:00
night_mode.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
notifications.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
overlays.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
padded_widget.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
page_params.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
panels.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
peer_data.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
people.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
pill_typeahead.js js: Convert static/js/typeahead_helper.js to ES6 module. 2021-02-28 14:23:00 -08:00
pm_conversations.js node tests: Clean pm_conversations more simply. 2021-03-18 16:37:20 -04:00
pm_list.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
pm_list_dom.js js: Convert static/js/pm_list_dom.js to ES6 module. 2021-02-28 14:23:00 -08:00
poll_widget.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
popovers.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
presence.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
reactions.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
ready.js ready: Wait for other ready callbacks before marking app loaded. 2021-03-14 17:36:22 -07:00
realm_icon.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
realm_logo.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
recent_senders.js node tests: Clean up recent_senders test. 2021-03-12 11:18:44 -05:00
recent_topics.js recent_topics: Directly pass jquery element instead of event object. 2021-03-16 14:54:22 -07:00
reload.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
reload_state.js channel: Sever dependency on reload. 2021-03-09 17:43:07 -08:00
reminder.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
rendered_markdown.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
resize.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
rows.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
rtl.js js: Convert static/js/rtl.js to ES6 module. 2021-02-28 14:23:00 -08:00
schema.js js: Convert static/js/schema.js to ES6 module. 2021-02-10 10:27:14 -08:00
scroll_bar.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
scroll_util.js js: Convert static/js/ui.js to ES6 module. 2021-03-02 17:06:35 -08:00
search.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
search_pill.js js: Convert static/js/input_pill.js to ES6 module. 2021-03-02 17:06:35 -08:00
search_pill_widget.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
search_suggestion.js js: Convert static/js/search_suggestion.js to ES6 module. 2021-02-28 14:23:00 -08:00
search_util.js js: Convert static/js/search_util.js to ES6 module. 2021-02-10 10:27:14 -08:00
sent_messages.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
server_events.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
server_events_dispatch.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
settings.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
settings_account.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
settings_bots.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_config.js display_settings: Allow user to set default_view. 2021-03-11 18:09:08 -08:00
settings_data.js js: Convert static/js/settings_data.js to ES6 module. 2021-02-10 10:27:14 -08:00
settings_display.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_emoji.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_exports.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_invites.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
settings_linkifiers.js linkifier settings: Remove loading indicator. 2021-03-15 11:19:59 -07:00
settings_muting.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_notifications.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_org.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
settings_panel_menu.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_profile_fields.js settings: Fix input mouse behaviour in custom profile fields. 2021-03-15 11:11:47 -07:00
settings_sections.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
settings_streams.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_toggle.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_user_groups.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
settings_users.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
setup.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
spoilers.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
starred_messages.js left sidebar: Don't show unstar-all button when redundant. 2021-03-18 15:52:06 -07:00
stream_color.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
stream_create.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
stream_data.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
stream_edit.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
stream_events.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
stream_list.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
stream_muting.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
stream_pill.js js: Convert static/js/stream_data.js to ES6 module. 2021-02-28 14:23:00 -08:00
stream_popover.js left sidebar: Don't show unstar-all button when redundant. 2021-03-18 15:52:06 -07:00
stream_sort.js code cleanup: Remove obsolete stream_sort code. 2021-03-13 11:48:50 -05:00
stream_topic_history.js js: Convert static/js/unread.js to ES6 module. 2021-03-02 17:06:35 -08:00
stream_ui_updates.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
submessage.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
subs.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
templates.js js: Convert static/js/templates.js to ES6 module. 2021-02-10 10:27:14 -08:00
timerender.js node tests: Ensure clean data for timerender tests. 2021-03-14 11:38:21 -04:00
todo_widget.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
top_left_corner.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
topic_generator.js js: Convert static/js/unread.js to ES6 module. 2021-03-02 17:06:35 -08:00
topic_list.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
topic_list_data.js js: Convert static/js/unread.js to ES6 module. 2021-03-02 17:06:35 -08:00
topic_zoom.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
transmit.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
tutorial.js js: Convert static/js/narrow.js to ES6 module. 2021-03-02 17:06:35 -08:00
typeahead_helper.js compose: Remove presence circles for wildcard users. 2021-03-12 02:10:21 -08:00
typing.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
typing_data.js node tests: Add test() wrapper for typing_data. 2021-03-15 13:05:49 -04:00
typing_events.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
ui.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
ui_init.js message view: Show message source button until message successfully sent. 2021-03-18 14:49:09 -07:00
ui_report.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
ui_util.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
unread.js minor: Don't export unread_topic_counter. 2021-03-10 07:07:34 -05:00
unread_ops.js js: Convert static/js/message_list.js to ES6 module. 2021-03-02 17:06:35 -08:00
unread_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
upload.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
upload_widget.js js: Convert static/js/upload_widget.js to ES6 module. 2021-02-28 14:23:00 -08:00
user_events.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
user_groups.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
user_pill.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
user_search.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
user_status.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
user_status_ui.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
util.js js: Convert static/js/util.js to ES6 module. 2021-02-10 10:27:14 -08:00
vdom.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
widgetize.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
zcommand.js js: Use jQuery as a module. 2021-03-12 10:08:25 -08:00
zform.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
zulip.js js: Convert static/js/message_list.js to ES6 module. 2021-03-02 17:06:35 -08:00
zulip_test.js zulip_test: Re-export internal functions used by Puppeteer tests. 2021-03-02 17:06:35 -08:00