zulip/frontend_tests/node_tests
Priyansh Garg 3294e8dbe0 compose-box: Insert quoted content at the cursor position.
Right now, on clicking `quote and reply` on any message, the quoted
message is always inserted at the top of compose-box irrespective of
the current cursor position. Also, after insertion of the quoted
message, the cursor is shifted at the end of the compose box.

This commit changes this behaviour to insertion of quoted message
at the current cursor position with a newline at the end of quote
and moving the cursor position to that newline after insertion.
A newline is added at the beginning of quoted message only if there
was some content already present in compose box before the previous
cursor position.

Tested on Google Chrome and Firefox browsers on Ubuntu dev environment.

Fixes: #16836
2021-07-06 16:38:17 -07:00
..
lib node tests: Replace incorrect assert with assert.equal in dispatch.js. 2021-06-08 10:28:21 -07:00
templates Revert "templates: Add {{#let}} block helper." 2021-04-13 17:41:10 -07:00
activity.js js: Split out muted_users module from muting. 2021-06-30 16:32:55 -07:00
alert_words.js people: Stop queries about current user in web_public_view. 2021-06-22 16:56:34 -07:00
alert_words_ui.js node tests: Only expose mock_template via run_test. 2021-06-27 23:00:34 -04:00
billing.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
billing_helpers.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
blueslip_stacktrace.js dependencies: Upgrade JavaScript dependencies. 2021-05-10 18:07:13 -07:00
bot_data.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
browser_history.js settings: Separate "Your account" section in two different sections. 2021-06-30 16:56:03 -07:00
buddy_data.js js: Split out muted_users module from muting. 2021-06-30 16:32:55 -07:00
buddy_list.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
channel.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -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 colorspace: Remove unused methods. 2021-05-21 16:53:30 -07:00
common.js refactor: Use variables to get TypeScript type narrowing. 2021-06-22 09:09:36 -07:00
components.js ts: Convert components module to TypeScript. 2021-07-05 17:04:06 -07:00
compose.js compose: Extract "compose_validate.js". 2021-07-05 19:21:56 -07:00
compose_actions.js compose-box: Insert quoted content at the cursor position. 2021-07-06 16:38:17 -07:00
compose_closed_ui.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
compose_error.js compose: Make a function to hide compose error. 2021-07-06 15:15:26 -07:00
compose_fade.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
compose_pm_pill.js input_pill: Customize pills for deactivated users. 2021-06-25 18:06:42 -07:00
compose_state.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
compose_ui.js compose-box: Insert quoted content at the cursor position. 2021-07-06 16:38:17 -07:00
compose_validate.js compose: Extract "compose_validate.js". 2021-07-05 19:21:56 -07:00
compose_video.js docs: Correct Big Blue Button to BigBlueButton. 2021-07-05 16:59:00 -07:00
composebox_typeahead.js js: Split out muted_users module from muting. 2021-06-30 16:32:55 -07:00
copy_and_paste.js zjsunit: Optionally exercise template code. 2021-06-15 12:33:26 -04:00
deprecated_feature_notice.js deprecated_feature_notice: Move code to a separate module. 2021-06-15 11:58:45 -07:00
dispatch.js settings: Remove default_language_name from page_params. 2021-06-17 16:56:21 -07:00
dispatch_subs.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
drafts.js node tests: Only expose mock_template via run_test. 2021-06-27 23:00:34 -04:00
dropdown_list_widget.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
echo.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
emoji.js zjsunit: Remove rewiremock dependency. 2021-03-06 11:10:57 -05:00
emoji_picker.js zjsunit: Remove rewiremock dependency. 2021-03-06 11:10:57 -05:00
example1.js custom_check: Avoid use of assert to avoid confusion with assert.equal. 2021-06-10 09:15:57 -07:00
example2.js refactor: Extract message_helper.process_new_message. 2021-03-29 14:53:57 -07:00
example3.js js: Convert static/js/page_params.js to ES6 module. 2021-03-26 10:17:56 -07:00
example4.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
example5.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
example6.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
example7.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
fenced_code.js node tests: Move test to fenced_code.js. 2021-03-12 11:18:44 -05:00
fetch_status.js zjsunit: Lift restriction against mocking third party modules. 2021-03-12 10:06:30 -08:00
filter.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
fold_dict.js custom_check: Avoid use of assert to avoid confusion with assert.equal. 2021-06-10 09:15:57 -07:00
hash_util.js settings: Separate "Your account" section in two different sections. 2021-06-30 16:56:03 -07:00
hashchange.js hashchange: Don't narrow to default_view on `#reload`. 2021-06-29 13:39:01 -07:00
hotkey.js streams: Eliminate content-editable to change stream info. 2021-07-05 14:35:15 -07:00
i18n.js node tests: Only expose mock_template via run_test. 2021-06-27 23:00:34 -04:00
input_pill.js node tests: Only expose mock_template via run_test. 2021-06-27 23:00:34 -04:00
keydown_util.js keydown_util: Use Event.key instead of deprecated properties. 2021-05-27 23:33:17 -07:00
lazy_set.js custom_check: Avoid use of assert to avoid confusion with assert.equal. 2021-06-10 09:15:57 -07:00
lightbox.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
linkifiers.js refactor: Extract linkifier non-settings logic from `markdown.js`. 2021-05-19 11:59:28 -07:00
list_cursor.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
list_widget.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
markdown.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
message_edit.js node tests: Fix failure resulting from recent rebase. 2021-06-16 16:40:39 -07:00
message_events.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
message_fetch.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
message_flags.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
message_list.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
message_list_data.js js: Rename muting module to muted_topics. 2021-06-30 16:32:55 -07:00
message_list_view.js js: Split out muted_users module from muting. 2021-06-30 16:32:55 -07:00
message_store.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
muting.js js: Rename muting module to muted_topics. 2021-06-30 16:32:55 -07:00
narrow.js narrow: Narrow to new/empty topics with Ctrl + . shortcut. 2021-07-05 09:52:19 -07:00
narrow_activate.js js: Rename muting module to muted_topics. 2021-06-30 16:32:55 -07:00
narrow_local.js custom_check: Avoid use of assert to avoid confusion with assert.equal. 2021-06-10 09:15:57 -07:00
narrow_state.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
narrow_unread.js js: Rename muting module to muted_topics. 2021-06-30 16:32:55 -07:00
navbar_alerts.js navbar_alerts: Don't ask spectator for notifications access. 2021-06-22 17:18:56 -07:00
notifications.js js: Rename muting module to muted_topics. 2021-06-30 16:32:55 -07:00
password.js custom_check: Avoid use of assert to avoid confusion with assert.equal. 2021-06-10 09:15:57 -07:00
peer_data.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
people.js js: Split out muted_users module from muting. 2021-06-30 16:32:55 -07:00
people_errors.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
pill_typeahead.js node tests: Only expose mock_template via run_test. 2021-06-27 23:00:34 -04:00
pm_conversations.js js: Rename muting module to muted_topics. 2021-06-30 16:32:55 -07:00
pm_list.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
poll_widget.js node tests: Only expose mock_template via run_test. 2021-06-27 23:00:34 -04:00
popovers.js copy_link: Add onSuccess listener to copy clipboard. 2021-07-02 11:33:37 -07:00
presence.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
reactions.js node tests: Only expose mock_template via run_test. 2021-06-27 23:00:34 -04:00
recent_senders.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
recent_topics.js recent_topics_timestamp: Fix tooltip. 2021-07-03 06:59:55 -04:00
reload_state.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
rendered_markdown.js markdown: Rewrite tooltips for <time> elements. 2021-07-05 18:09:47 -07:00
rtl.js custom_check: Avoid use of assert to avoid confusion with assert.equal. 2021-06-10 09:15:57 -07:00
schema.js node_tests: Don’t read from most deprecated global variables. 2021-02-10 07:40:22 -08:00
scroll_util.js zjsunit: Lift restriction against mocking third party modules. 2021-03-12 10:06:30 -08:00
search.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
search_legacy.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
search_pill.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
search_suggestion.js people: Stop queries about current user in web_public_view. 2021-06-22 16:56:34 -07:00
search_suggestion_legacy.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
server_events.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
settings_bots.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
settings_config.js js: Convert static/js/page_params.js to ES6 module. 2021-03-26 10:17:56 -07:00
settings_data.js tests: Extract can_edit_topic_of_any_message node test in a function. 2021-06-29 17:37:52 -07:00
settings_emoji.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
settings_muted_topics.js js: Rename muting module to muted_topics. 2021-06-30 16:32:55 -07:00
settings_muted_users.js js: Split out muted_users module from muting. 2021-06-30 16:32:55 -07:00
settings_org.js docs: Correct Big Blue Button to BigBlueButton. 2021-07-05 16:59:00 -07:00
settings_profile_fields.js node tests: Only expose mock_template via run_test. 2021-06-27 23:00:34 -04:00
settings_user_groups.js node tests: Only expose mock_template via run_test. 2021-06-27 23:00:34 -04:00
spoilers.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
starred_messages.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
stream_data.js streams: Add function to get subscribed streams of a user. 2021-06-17 17:57:20 -07:00
stream_edit.js stream settings: Rename stream_subscription_info for readability. 2021-06-30 14:54:28 -07:00
stream_events.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
stream_list.js node tests: Only expose mock_template via run_test. 2021-06-27 23:00:34 -04:00
stream_pill.js refactor: Add type field to pill items. 2021-04-27 12:07:57 -07:00
stream_search.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
stream_sort.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
stream_topic_history.js message_edit: Fix live update bug in left sidebar. 2021-06-29 10:00:52 -07:00
submessage.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
subs.js node tests: Only expose mock_template via run_test. 2021-06-27 23:00:34 -04:00
support.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
templates.js zjsunit: Optionally exercise template code. 2021-06-15 12:33:26 -04:00
timerender.js timerender: Extract timezone offset string generation to a function. 2021-07-05 18:08:18 -07:00
top_left_corner.js people: Allow deactivated users pills in compose box. 2021-06-25 18:01:15 -07:00
topic_generator.js js: Rename muting module to muted_topics. 2021-06-30 16:32:55 -07:00
topic_list_data.js left-sidebar: Add support for showing resolve-topic-prefix. 2021-07-05 18:02:40 -07:00
transmit.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
typeahead.js minor: Check if typeahead query exists. 2021-03-25 02:08:51 -07:00
typeahead_helper.js node tests: Only expose mock_template via run_test. 2021-06-27 23:00:34 -04:00
typing_data.js js: Split out muted_users module from muting. 2021-06-30 16:32:55 -07:00
typing_status.js node tests: Use {override} in run_test. 2021-06-16 12:55:53 -04:00
unread.js js: Rename muting module to muted_topics. 2021-06-30 16:32:55 -07:00
upgrade.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
upload.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
user_events.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
user_group_pill.js refactor: Add type field to pill items. 2021-04-27 12:07:57 -07:00
user_groups.js custom_check: Avoid use of assert to avoid confusion with assert.equal. 2021-06-10 09:15:57 -07:00
user_pill.js input_pill: Customize pills for deactivated users. 2021-06-25 18:06:42 -07:00
user_search.js js: Split out muted_users module from muting. 2021-06-30 16:32:55 -07:00
user_status.js custom_check: Avoid use of assert to avoid confusion with assert.equal. 2021-06-10 09:15:57 -07:00
util.js util: Remove unused code for lower_bound. 2021-07-02 11:37:01 -07:00
vdom.js custom_check: Avoid use of assert to avoid confusion with assert.equal. 2021-06-10 09:15:57 -07:00
watchdog.js custom_check: Avoid use of assert to avoid confusion with assert.equal. 2021-06-10 09:15:57 -07:00
widgetize.js zjsunit: Wire $ to zjquery by default. 2021-06-16 12:55:53 -04:00
zblueslip.js js: Convert static/js/blueslip.js to ES6 module. 2021-03-17 08:47:15 -04:00
zjquery.js custom_check: Avoid use of assert to avoid confusion with assert.equal. 2021-06-10 09:15:57 -07:00