zulip/web/tests
apoorva 55ddde8411 copy_paste: Preserve timestamps across copy-paste.
When a user partially selects text inside a rendered <time> element,
Chrome's clipboard serializer strips the <time> wrapper from the
paste HTML along with the .timestamp-content-wrapper span, losing
the `datetime` attribute needed to reconstruct the `<time:ISO>`
markdown.

We expand the selection range to cover the full <time> element (same
trick the KaTeX path uses to keep its annotation), and at copy time
wrap the localized date text in a fresh `<span data-datetime="...">`.

The paste rule recovers the markdown via the surviving `<time>` tag
(cross-element selections) or the wrapping `<span data-datetime>`
(in-time selections, where Chrome has stripped the <time>).

Fixes: https://chat.zulip.org/#narrow/channel/138-user-questions/topic/Copy-paste-ability.20of.20global.20times/with/2462937
2026-05-29 16:14:29 +05:30
..
lib compose_reply: Use new channel syntax in forwarded message context. 2026-05-19 13:16:25 +05:30
templates templates: Add object_entries helper. 2026-01-21 17:04:08 -08:00
activity_init.test.cjs tests: Use existing zjquery event handlers. 2026-03-06 09:02:45 -08:00
activity_post.test.cjs activity tests: Improve actual coverage. 2026-01-05 16:50:33 -08:00
activity_ui.test.cjs filter: Use user_id instead email for user type operators. 2026-01-29 14:09:25 -08:00
activity.test.cjs zjquery: Move append method to FakeElement. 2026-03-06 09:02:45 -08:00
alert_words_ui.test.cjs tests: Require template mocks to return a string. 2026-03-06 09:02:45 -08:00
alert_words.test.cjs tests: Use typed helpers in alert_words.test.cjs. 2026-02-17 17:28:56 -08:00
background_task.test.cjs buddy_list: Introduce background_task for non awaited code. 2026-01-07 15:36:03 -08:00
blueslip_stacktrace.test.cjs tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
bot_data.test.cjs bots: Remove duplicate fields from bot objects in realm_bots. 2026-03-03 17:36:43 -08:00
box_resize.test.cjs box_resize tests: Restore document and getComputedStyle via set_global. 2026-04-24 22:54:16 +00:00
browser_history.test.cjs tests: Remove rewires in browser_history.test.cjs. 2026-02-18 00:31:50 -08:00
browser_support.test.cjs ui_init: Show unsupported browser warning on load. 2026-01-12 16:34:54 -08:00
buddy_data.test.cjs users: Filter deleted users from deactivated tab and sidebar. 2026-04-15 14:47:06 -07:00
buddy_list.test.cjs tests: Avoid comparing identities of fake jQuery objects. 2026-03-06 09:02:45 -08:00
channel_folders.test.cjs stream-settings: Allow filtering streams by folder. 2026-01-06 15:41:07 -08:00
channel.test.cjs channel: Remove PATCH as POST workaround. 2025-05-05 12:13:00 -07:00
clipboard_handler.test.cjs clipboard_handler.test.cjs: Use example factories for user and stream. 2026-02-24 13:15:01 -08:00
color_data.test.cjs tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
common.test.cjs password: Replace Font Awesome eye icons with zulip-icon show/hide. 2026-04-20 18:12:06 -07:00
components.test.cjs components: Add key() accessor to toggle, and fix misuse of value(). 2026-05-22 15:52:56 +05:30
compose_actions.test.cjs compose_reply: Use new channel syntax in forwarded message context. 2026-05-19 13:16:25 +05:30
compose_call_session.test.cjs compose_call: Introduce ComposeCallSession. 2026-04-18 16:11:01 -07:00
compose_call.test.cjs compose_call: Introduce ComposeCallSession. 2026-04-18 16:11:01 -07:00
compose_closed_ui.test.cjs tests: Use typed helpers in compose_closed_ui.test.cjs. 2026-02-17 17:28:56 -08:00
compose_fade.test.cjs compose_fade: Use user_ids directly instead of email round-trip. 2026-04-14 13:52:43 -07:00
compose_paste.test.cjs copy_paste: Preserve timestamps across copy-paste. 2026-05-29 16:14:29 +05:30
compose_pm_pill.test.cjs compose_state: Remove no-op update_email and set_from_emails. 2026-04-14 13:52:43 -07:00
compose_reply.test.cjs quote: Introduce quoting multiple messages. 2026-04-14 16:18:05 -07:00
compose_state.test.cjs web/tests: Use example stream factories in several test files. 2026-04-14 16:45:36 -07:00
compose_ui.test.cjs compose_ui: Test reverse template that does not re-match pattern. 2026-05-19 21:50:56 -07:00
compose_validate.test.cjs compose_validate: Fix code to check permission for resolving topics. 2026-04-24 09:31:20 -07:00
compose.test.cjs markdown: Use RE2JS for linkifier rendering. 2026-05-19 21:50:56 -07:00
composebox_typeahead.test.cjs compose: Preserve indentation when continuing lists. 2026-05-05 18:00:37 -07:00
conversation_participants.test.cjs people: Optimize is_person_active. 2025-06-06 10:53:03 -07:00
demo_organizations.test.cjs tests: Use make_realm to create type-correct realm objects. 2025-08-28 11:35:07 -07:00
deprecated_feature_notice.test.cjs tests: Don’t mock i18n. 2026-02-04 03:16:20 -08:00
direct_message_group_data.test.cjs people: Remove unused emails_strings_to_user_ids_string. 2026-04-14 13:52:43 -07:00
dispatch_subs.test.cjs events: Fix stream/delete default streams update order. 2026-04-05 11:00:51 -07:00
dispatch.test.cjs web: Switch to the new individual_emoji_changes capability. 2026-04-16 20:44:57 -07:00
drafts.test.cjs drafts: Fix initial focus in drafts overlay. 2026-04-09 19:02:55 -07:00
echo.test.cjs markdown: Use RE2JS for linkifier rendering. 2026-05-19 21:50:56 -07:00
electron_bridge.test.cjs tests: Remove rewires in electron_bridge.test.cjs. 2026-02-18 00:31:50 -08:00
emoji_picker.test.cjs emoji_frequency: Compute emoji scores in preferred_emoji_list. 2026-03-11 14:44:13 -07:00
emoji.test.cjs emoji: Remap ':smile' emoji and update the settings UI. 2025-04-07 17:34:52 -07:00
example1.test.cjs stream_data: Rename add_sub to add_sub_for_tests. 2025-09-30 12:52:47 -07:00
example2.test.cjs submessage: Process submessage once on server message fetch. 2026-02-25 09:09:46 -08:00
example3.test.cjs stream_data: Rename add_sub to add_sub_for_tests. 2025-09-30 12:52:47 -07:00
example4.test.cjs bots: Remove duplicate fields from bot objects in realm_bots. 2026-03-03 17:36:43 -08:00
example5.test.cjs stream_list: Restore scroll position for user after update. 2026-03-10 11:52:34 -07:00
example6.test.cjs tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
example7.test.cjs zjquery: Move css accessor to FakeElement. 2026-03-06 09:02:45 -08:00
example8.test.cjs filter: Use user_id instead email for user type operators. 2026-01-29 14:09:25 -08:00
fenced_code.test.cjs fenced_code: Add tests for wrap_code, quote/math/spoiler blocks. 2026-03-10 13:06:45 -07:00
fetch_status.test.cjs tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
filter.test.cjs filter: Redirect mentions:me to is:mentioned. 2026-04-24 15:27:29 -07:00
focus_outline_util.test.cjs recent_view: Supress focus outline till first user keypress. 2026-03-06 11:29:42 -08:00
fold_dict.test.cjs tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
folder_dropdown_widget.test.cjs tests: Use elements as jQuery object items. 2026-03-06 09:02:45 -08:00
gear_menu_util.test.cjs tests: Use make_realm to create type-correct realm objects. 2025-08-28 11:35:07 -07:00
hash_util.test.cjs filter: Redirect mentions:me to is:mentioned. 2026-04-24 15:27:29 -07:00
hashchange.test.cjs web/tests: Use example stream factories in several test files. 2026-04-14 16:45:36 -07:00
hotkey.test.cjs hotkey: Fix Cmd+<shifted_symbol> shortcuts on macOS. 2026-04-20 18:45:38 -07:00
i18n.test.cjs tests: Require template mocks to return a string. 2026-03-06 09:02:45 -08:00
input_pill.test.cjs zjquery: Use elements for next, prev accessors. 2026-03-06 09:02:45 -08:00
internal_url.test.cjs internal_url: Exclude stream name from encoded slug if it is too long. 2026-04-18 19:38:34 -07:00
keydown_util.test.cjs tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
lazy_set.test.cjs tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
left_sidebar_navigation_area.test.cjs left_sidebar: Modal styling for more topics. 2026-03-06 17:20:03 -08:00
lightbox.test.cjs lightbox: Support bare images in parse_media_data. 2026-03-11 17:30:37 -07:00
linkifiers.test.cjs markdown: Use RE2JS for linkifier rendering. 2026-05-19 21:50:56 -07:00
list_cursor.test.cjs tests: Use elements as jQuery object items. 2026-03-06 09:02:45 -08:00
list_widget.test.cjs recent_view: Add "Channel" header as a sort-by-channel button. 2026-03-06 11:29:42 -08:00
markdown_parse.test.cjs markdown: Use RE2JS for linkifier rendering. 2026-05-19 21:50:56 -07:00
markdown.test.cjs markdown: Use RE2JS for linkifier rendering. 2026-05-19 21:50:56 -07:00
message_delete.test.cjs tests: Use typed helpers in message_delete.test.cjs. 2026-02-17 17:28:56 -08:00
message_edit.test.cjs message: Make sure submessages is always defined. 2025-09-09 09:20:40 -07:00
message_events.test.cjs topics: Handle case only topic name change. 2026-02-23 16:53:44 -08:00
message_fetch_raw_content.test.cjs raw_content: Introduce library to fetch raw_content. 2026-03-26 17:10:54 -07:00
message_fetch.test.cjs messages: Add jump to date picker. 2026-02-06 18:43:28 -08:00
message_flags.test.cjs tests: Unmock _.debounce, _.throttle. 2026-03-03 09:56:34 -08:00
message_list_data.test.cjs filter: Use user_id instead email for user type operators. 2026-01-29 14:09:25 -08:00
message_list_view.test.cjs polls: Show edited marker when poll is modified. 2026-04-14 15:47:07 -07:00
message_list.test.cjs tests: Remove mutation of $. 2026-03-06 09:02:45 -08:00
message_store.test.cjs message_store: Pass message id to maybe_update_raw_content. 2026-03-26 17:10:54 -07:00
message_view.test.cjs filter: Add mentions: search operator for filtering by user mentions. 2026-04-24 15:27:29 -07:00
muted_users.test.cjs node tests: Use consistent import strategy for example_*.cjs. 2026-02-17 17:28:56 -08:00
narrow_local.test.cjs all_messages_data: Rename to recent_view_messages_data. 2026-02-26 11:34:40 -08:00
narrow_state.test.cjs tests: Reformat single-line make_stream calls to multi-line style. 2026-02-17 17:28:56 -08:00
narrow_unread.test.cjs tests: Use typed helpers in narrow_unread.test.cjs. 2026-02-17 17:28:56 -08:00
navbar_alerts.test.cjs tests: Use make_realm to create type-correct realm objects. 2025-08-28 11:35:07 -07:00
navigation_views.test.cjs tests: Use typed helpers in navigation_views.test.cjs. 2026-02-17 17:28:56 -08:00
notifications.test.cjs notifications: Channel wildcard notification setting overrides muting. 2026-03-11 16:48:57 -07:00
password.test.cjs eslint: Fix unicorn/no-immediate-mutation. 2025-11-01 07:24:57 -07:00
peer_data.test.cjs recent_view: Redefine channel max width. 2026-02-24 14:55:24 -08:00
people_errors.test.cjs people: Demote "Added user late" log during initial events catchup. 2026-05-20 11:17:18 +05:30
people.test.cjs people: Demote "Added user late" log during initial events catchup. 2026-05-20 11:17:18 +05:30
pill_typeahead.test.cjs bootstrap_typeahead: Change matcher to accept query & return a function. 2026-04-23 17:40:18 -07:00
pm_conversations.test.cjs tests: Use typed helpers in pm_conversations.test.cjs. 2026-02-17 17:28:56 -08:00
pm_list_data.test.cjs pm_list: Show unread DMs with deactivated users in unzoomed view. 2026-05-20 10:26:50 +05:30
pm_list.test.cjs left_sidebar: Modal styling for more DM conversations. 2026-03-06 17:20:03 -08:00
poll_widget.test.cjs widgets: Separate out widget initialization and ui render. 2026-02-25 09:09:46 -08:00
popover_menus_data.test.cjs popovers: Exclude clicked date from "Scroll to" suggestions. 2026-05-22 18:57:14 +05:30
postprocess_content.test.cjs web: Use slash syntax for aspect-ratio to fix JSDOM tests. 2026-04-24 13:32:25 -07:00
presence.test.cjs tests: presence.test.cjs: Remove invalid date_joined mocks. 2026-05-05 17:52:35 -07:00
reactions.test.cjs reactions: Live-update vote text in pills on user rename. 2026-04-18 18:16:13 -07:00
realm_playground.test.cjs tests: Don’t mock i18n. 2026-02-04 03:16:20 -08:00
recent_senders.test.cjs recent_senders test: Avoid mocking message_store. 2026-03-13 16:37:59 -07:00
recent_view.test.cjs recent_view_tests: Avoid mocking message_store. 2026-03-13 16:37:59 -07:00
reload_state.test.cjs tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
reload.test.cjs reload: Defer state_data fetching to avoid partial-transfer failures. 2026-04-21 08:13:38 -07:00
rendered_markdown.test.cjs markdown: Add inline preview support for .mov video files. 2026-04-24 09:50:03 -07:00
resolved_topic.test.cjs shared: Move resolved_topic.ts to web/src. 2025-11-11 09:06:18 -08:00
rtl.test.cjs tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
saved_snippets.test.cjs tests: Use make_user in saved_snippets tests. 2026-04-14 16:43:13 -07:00
scheduled_messages.test.cjs tests: Use make_realm to create type-correct realm objects. 2025-08-28 11:35:07 -07:00
scroll_util.test.cjs scroll_util: Account for $elem not direct child of scroll container. 2025-01-23 15:53:09 -08:00
search_suggestion.test.cjs filter: Add mentions: search operator for filtering by user mentions. 2026-04-24 15:27:29 -07:00
search.test.cjs search tests: Fix swapped item_html arguments for mentions: case. 2026-04-24 23:13:34 +00:00
server_events.test.cjs message: Differentiate between new local messages and server messages. 2025-10-01 16:38:55 -07:00
settings_bots.test.cjs bots: Remove duplicate fields from bot objects in realm_bots. 2026-03-03 17:36:43 -08:00
settings_config.test.cjs tests: Use make_realm to create type-correct realm objects. 2025-08-28 11:35:07 -07:00
settings_data.test.cjs settings_data: Handle EVERYONE_ON_INTERNET in permission checks. 2026-04-17 16:48:48 -07:00
settings_emoji.test.cjs tests: Avoid comparing identities of fake jQuery objects. 2026-03-06 09:02:45 -08:00
settings_muted_users.test.cjs zjquery: Move closest accessor to FakeElementState. 2026-03-06 09:02:45 -08:00
settings_org.test.cjs settings: Fade out save/discard controls on failure. 2026-05-18 14:16:06 -05:00
settings_profile_fields.test.cjs custom_profile_fields: Refactor internal constants. 2026-04-13 09:14:53 -07:00
settings_realm_domains.test.cjs zjquery: Move fadeIn, fadeOut methods to FakeElementState. 2026-03-06 09:02:45 -08:00
settings_user_topics.test.cjs web/tests: Use example stream factories in several test files. 2026-04-14 16:45:36 -07:00
spoilers.test.cjs zjquery: Use elements for find accessor. 2026-03-06 09:02:45 -08:00
starred_messages.test.cjs message: Create new LocalMessage to fix type of transmit.send_message. 2025-10-01 16:38:55 -07:00
stream_create_subscribers_data.test.cjs tests: Use typed helpers in stream_create_subscribers_data.test.cjs. 2026-02-17 17:28:56 -08:00
stream_data.test.cjs message-list-view: Remove hack for undefined StreamSubscription. 2026-05-29 13:45:51 +05:30
stream_edit.test.cjs tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
stream_events.test.cjs tests: Create empty jQuery objects with set_results. 2026-03-06 09:02:45 -08:00
stream_list_sort.test.cjs stream_list: Rename StreamListSection.streams. 2026-01-19 06:42:57 -08:00
stream_list.test.cjs stream_list: Fully remove deleted test. 2026-04-05 11:06:46 -07:00
stream_pill.test.cjs stream_pill: Remove unused show_subscriber_count field. 2026-05-08 19:03:25 -07:00
stream_settings_ui.test.cjs zjquery: Use elements for children accessor. 2026-03-06 09:02:45 -08:00
stream_topic_history.test.cjs tests: Use make_stream in stream_topic-history tests. 2026-04-14 16:42:33 -07:00
submessage.test.cjs submessage: Add helpers to detect poll messages and widget edits. 2026-04-14 15:47:07 -07:00
support.test.cjs tests: Use existing zjquery attr accessor. 2026-03-06 09:02:45 -08:00
templates.test.cjs templates: Forbid looping over non-arrays. 2026-01-21 17:04:08 -08:00
timerender.test.cjs tests: Use existing zjquery text accessor. 2026-03-06 09:02:45 -08:00
topic_generator.test.cjs topic_generator: Check topics in current channel before next channel. 2026-02-26 11:22:29 -08:00
topic_link_util.test.cjs internal_url: Exclude stream name from encoded slug if it is too long. 2026-04-18 19:38:34 -07:00
topic_list_data.test.cjs web/tests: Use example stream factories in several test files. 2026-04-14 16:45:36 -07:00
topic_list.test.cjs all_messages_data: Rename to recent_view_messages_data. 2026-02-26 11:34:40 -08:00
transmit.test.cjs web/tests: Use example stream factories in several test files. 2026-04-14 16:45:36 -07:00
typeahead_helper.test.cjs typeahead: Show email only when it's not null. 2026-05-08 19:04:34 -07:00
typeahead.test.cjs typeahead: Fix multi-word queries not matching names with diacritics. 2026-04-23 17:40:18 -07:00
typing_data.test.cjs message_edit: Show typing indicator for message editing. 2025-02-12 15:08:56 -08:00
typing_events.test.cjs tests: Use typed helpers in typing_events.test.cjs. 2026-02-17 17:28:56 -08:00
typing_status.test.cjs shared: Move typing_status.ts to web/src. 2025-11-11 09:06:18 -08:00
ui_util.test.cjs zjquery: Use elements for children accessor. 2026-03-06 09:02:45 -08:00
unread_ops.test.cjs modal: Add options for marking messages as read. 2025-07-10 17:57:25 -07:00
unread.test.cjs topics: Topic name case change should be reflected in inbox view. 2026-02-23 16:53:44 -08:00
upload.test.cjs compose_validate: Remove posting_policy_error_message state tracking. 2026-04-23 17:35:02 -07:00
user_events.test.cjs compose_state: Remove no-op update_email and set_from_emails. 2026-04-14 13:52:43 -07:00
user_group_pill.test.cjs decorated_channel_name: Fix icon-text spacing and alignment issues. 2026-03-26 13:15:03 -07:00
user_groups.test.cjs node tests: Use consistent import strategy for example_*.cjs. 2026-02-17 17:28:56 -08:00
user_pill.test.cjs tests: Use typed helpers in user_pill.test.cjs. 2026-02-17 17:28:56 -08:00
user_search.test.cjs web/tests: Use example stream factories in several test files. 2026-04-14 16:45:36 -07:00
user_status.test.cjs web: Switch to Zod mini API. 2025-07-21 16:40:17 -07:00
user_topics_ui.test.cjs tests: user_topics_ui.test.cjs: use example stream factory. 2026-02-26 10:53:10 -08:00
user_topics.test.cjs tests: user_topics.test.cjs: use example stream factories. 2026-02-26 10:52:50 -08:00
util.test.cjs user_profile: Sort streams by non-archived and archived status. 2026-05-26 16:23:52 -07:00
vdom.test.cjs tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
watchdog.test.cjs tests: Switch from mockdate to @sinonjs/fake-timers. 2026-03-03 09:56:34 -08:00
widgetize.test.cjs zjquery: Move append method to FakeElement. 2026-03-06 09:02:45 -08:00
zblueslip.test.cjs tests: Rename the Node tests to *.cjs. 2024-11-13 09:18:56 -08:00
zjquery.test.cjs zjquery: Use elements for find accessor. 2026-03-06 09:02:45 -08:00