Commit Graph

1123 Commits

Author SHA1 Message Date
Steve Howell
b559364614 Use zjquery to test pm_list.js.
We now stub templates.render() to see what data gets passed in
to the template, rather than using jQuery to inspect the DOM that
gets created.  This changes the nature of the test to be less about
integration with the templating layer and more about how we pass
data into the template.

To compensate, we add more assertions to the relevant test
in templates.js.
2017-05-30 20:46:30 -07:00
K.Kanakhin
2434f2d96c messages: Add support for admins deleting messages.
This makes it possible for Zulip administrators to delete messages.
This is primarily intended for use in deleting early test messages,
but it can solve other problems as well.

Later we'll want to play with the permissions model for this, but for
now, the goal is just to integrate the feature.

Note that it saves the deleted messages for some time using the same
approach as Zulip's message retention policy feature.

Fixes #135.
2017-05-29 21:59:38 -07:00
Steve Howell
879abd6290 Add coverage for update_existing_reaction(). 2017-05-29 20:10:53 -07:00
Steve Howell
1ae66cda6f Increase test coverage for insert_new_reaction. 2017-05-29 20:10:53 -07:00
Steve Howell
80920438a5 Add coverage for get_emojis_used_by_user_for_message_id. 2017-05-29 20:10:53 -07:00
Steve Howell
ecbbc8788a Move code from reactions -> emoji_picker.
This moves all the code dealing with emoji_picker
navigation and click/enter events to emoji_picker.js.

Some of the code still delegates back to reactions.js
in some way.

The navigate() code really does nothing reaction-specific,
nor does filter_emojis(), nor do some of their helpers.

This was mostly moving code, but I also did some
s/reaction// or s/reaction/emoji/ in names.
2017-05-29 17:10:05 -06:00
Steve Howell
ed2ceb49cb Use toggle_emoji_reaction for "+" hotkey.
This is a more direct codepath when we know which emoji
we want to toggle.
2017-05-29 17:10:05 -06:00
Steve Howell
805c99ae27 Add hide_emoji_popover() to toggle_emoji_reaction().
This change sets us up to de-duplicate some code.  It
changes behavior for the edge case situation where
you had the reaction menu open but then decide to
click on one of the existing reactions.  This change
closes the emoji popover, which is probably the
correct behavior.
2017-05-29 17:10:04 -06:00
Steve Howell
63d0711c4b Rename message_reaction_on_click() to toggle_emoji_reaction().
This prepares us to de-duplicate some code.
2017-05-29 17:10:04 -06:00
Steve Howell
49e3ee36c4 Add tests for reactions.remove_reaction(). 2017-05-29 14:59:52 -07:00
Steve Howell
affff8ac82 Extract reactions.set_reaction_count. 2017-05-29 14:59:52 -07:00
Rohitt Vashishtha
2d73e03e37 ui-refactor: Rename modals.js to overlays.js.
Fixed #4702.
2017-05-29 11:24:46 -07:00
David
43e76816ff message view: Recipient bar date stamp shows older years.
timerender.js render_now() will always include older
years when rendering the date stamp on the recipient bar
and the date rows above messages.

Fixes #4843.
2017-05-29 08:54:06 -07:00
David
fcf97660db testing-coverage: add node tests for timerender.js.
Initial set of tests for the timerender.js module.

Fixes #4819.
2017-05-29 08:51:28 -07:00
Steve Howell
cb0527397e Add tests for reactions.add_reaction(). 2017-05-28 16:58:32 -07:00
Steve Howell
8d7cd2e3af Add tests for reactions.message_reaction_on_click(). 2017-05-28 16:58:32 -07:00
Sarah
e304c47970 settings_org: Split out separate forms for orgs settings/permissions/auth.
Steve Howell also contributed to this PR.
2017-05-25 14:18:04 -07:00
Yago González
d7ecb252df node tests: Add tests for colorspace.js. 2017-05-25 10:09:39 -07:00
Yago González
f25c16b573 node tests: Add coverage for get_all_bots_for_current_user. 2017-05-25 09:54:05 -07:00
Yago González
115b2f6b6b node tests: Fix indentation. 2017-05-25 09:54:05 -07:00
Tim Abbott
74ad90533d node: Fix missing bot_data initialization.
This was making the frontend tests fail.
2017-05-24 19:59:40 -07:00
Steve Howell
6518c63b14 node tests: Add tests to activity.js. 2017-05-24 17:41:41 -07:00
Steve Howell
689605dd2e Introduce make_zjquery(). 2017-05-24 17:41:41 -07:00
Steve Howell
6c7a5260fc node tests: Add tests for filtering user ids in user list. 2017-05-24 17:41:41 -07:00
Steve Howell
5c09bec5e9 node tests: Use zjquery for entire activity test. 2017-05-24 17:41:41 -07:00
Steve Howell
46e72289d1 Add features to zjquery. 2017-05-24 17:41:41 -07:00
Steve Howell
4cfd9aa689 Add test coverage for activity unread counts. 2017-05-24 13:08:54 -07:00
Steve Howell
4a062d47a6 Add more features to zjquery. 2017-05-24 13:08:54 -07:00
Cynthia Lin
2045426ab9 hotkeys: Change subscribe stream hotkey to S. 2017-05-24 12:19:15 -07:00
Steve Howell
a9f6f5f0c0 node tests: Split out presence.js. 2017-05-24 09:18:24 -07:00
Steve Howell
c02f4b4756 Add people.initialize().
This makes us not have to stub jquery in many of our node
tests!
2017-05-23 19:35:08 -07:00
Joshua Pan
43487c6c3f node_tests: Get unread.js to 100% node coverage. 2017-05-23 19:04:02 -07:00
Joshua Pan
d44626d456 node_tests: Get topic_generator.js to 100% node coverage. 2017-05-23 19:00:56 -07:00
Steve Howell
7c1b555331 node tests: Use zjquery for common.js tests. 2017-05-23 18:52:25 -07:00
Steve Howell
1cb58d72b2 zjquery: Add focus/blur methods. 2017-05-23 18:52:25 -07:00
Steve Howell
cd08bbe7d8 zjquery: Add array-like functionality to elements.
(We simulate the behavior that a jquery object looks like an
array, but also has methods that can be called as if it were a
scalar.)
2017-05-23 18:52:25 -07:00
Steve Howell
4c520780a1 zjquery: Support $(func) flavor of $() calls. 2017-05-23 18:52:25 -07:00
Joshua Pan
f3369b266a node_tests: Extract and create fake_jquery as zjquery.
This allows us to use fake_jquery (originally only in
compose_actions.js) in all our node tests.
2017-05-23 10:27:07 -07:00
Joshua Pan
f8e10ed2f6 node_tests: Add test coverage to autofocus. 2017-05-23 10:26:30 -07:00
Joshua Pan
525cc34491 node_tests: Add test for long low-quality passwords. 2017-05-23 10:26:30 -07:00
Steve Howell
e00f9f3dcb Split out Organization Permissions page. 2017-05-18 12:37:03 -07:00
Steve Howell
d0ea11f355 Have "n" key skip muted streams. 2017-05-17 11:28:33 -07:00
Steve Howell
6f73b7953f Have "n" key skip muted topics. 2017-05-17 11:28:33 -07:00
Harshit Bansal
d827cc878b emoji.js: Remove unnecessary indirection.
Remove unnecessary function `emoji_name_to_css_class()` called while
populating `emojis_name_to_css_class` dict.
2017-05-17 08:09:50 -07:00
Steve Howell
7d153c9f8a Revert "muting.js: Track muted streams using stream id."
This reverts commit c7f710b8d4.

Because the back end still stores muted topics fundamentally using
stream name as a key, trying to cut over the client to use stream
id was just making things more brittle.  Mutes would work after
renaming the stream, which was progress in the change that we
revert here, but only until page load.  The other problem, which
is more severe, is that the order of page loading functions would
cause no mutes to happen at page load time.  This could be fixed
to some degree, but we should do a deeper fix on the back end.
2017-05-17 07:06:32 -07:00
Tim Abbott
00c7f7d42f Remove date separators from the top of the message feed.
Now that we have the date visible in the recipient rows, we no longer
need a top-of-feed date separator.

Fixes #4581.
2017-05-16 14:47:04 -07:00
Tim Abbott
df5a0e7c92 hotkeys: Simplify logic for checking for subscriptions page. 2017-05-15 20:28:56 -07:00
Steve Howell
c7f710b8d4 muting.js: Track muted streams using stream id.
This should prevent some glitches with stream rename events.
2017-05-15 14:47:41 -07:00
Steve Howell
1a11042fdf refactor: Use stream id more in topic_list.js. 2017-05-15 14:47:41 -07:00
Steve Howell
efb35afeb7 Track recent topics (and active streams) using stream id.
This commit changes the key for recent_topics to be a
stream id.  For streams that have been renamed, we will now
get accurate data on recent topics and active streams as
long as stream_data.get_stream_id(stream_name) returns a
valid value.
2017-05-15 14:47:41 -07:00