Commit Graph

1079 Commits

Author SHA1 Message Date
Steve Howell
22dfb9f09d Add test_update_dom_with_unread_counts(). 2017-05-31 09:10:43 -07:00
Steve Howell
0b0c57bbe0 zjquery: Throw Error() object to get tracebacks.
If you throw a raw string in node, you don't get a traceback.
2017-05-31 09:10:43 -07:00
Umair Khan
6ee08e0602 casper: Fix waiting condition in message deletion tests.
We now specifically wait for the length to decrease by one. This seems
like a more deterministic condition to wait on.

Previously we were waiting till the id of the deleted message remained
visible; intuitively, this should have worked but it seems that there
is some race condition that was causing the test to fail sporadically.
2017-05-30 22:49:59 -07:00
Steve Howell
4ec1260b41 reactions.js: Have an initialize() function. 2017-05-30 21:43:18 -07:00
Steve Howell
6149111b5e Add test_error_handling() for reactions.js. 2017-05-30 21:43:18 -07:00
Steve Howell
b0b647c9e5 Add more code to test_add_and_remove_reaction().
This increases our line coverage a bit.
2017-05-30 21:43:18 -07:00
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