Commit Graph

3538 Commits

Author SHA1 Message Date
Steve Howell
cbd1ac24f4 node tests: Set platform more explicitly. 2021-05-19 15:55:03 -04:00
Steve Howell
1ee8157239 node tests: Remove document set_global. 2021-05-19 15:55:03 -04:00
Steve Howell
09ce61f18f node test: Eliminate mock_channel_post helper.
We now do a single override that closes on
current_message.
2021-05-19 15:55:03 -04:00
Steve Howell
5a90edf5e7 node tests: Use override more in compose tests. 2021-05-19 15:55:03 -04:00
Steve Howell
cc6310b57d node tests: Localize MockDate call. 2021-05-19 15:55:03 -04:00
Steve Howell
b543116193 node tests: Eliminate redundant "social" sub. 2021-05-19 15:55:03 -04:00
Steve Howell
62eca19b86 node tests: Eliminate sloppy_$ for compose tests. 2021-05-19 15:55:03 -04:00
Steve Howell
967506bbc7 node tests: Simplify rtl testing. 2021-05-19 15:55:03 -04:00
Steve Howell
394c4b32cf minor: Sort zrequire statements. 2021-05-19 15:55:03 -04:00
Steve Howell
7eece8a80e node tests: Remove sloppy_$ for compose_validate. 2021-05-19 15:55:03 -04:00
Steve Howell
48e5077201 node tests: Extract compose_validate.js
This is pretty much a verbatim code move,
except that I inlined noop and reset_jquery
in the new file.

Also, in the last test, I no longer reset
the compose state.
2021-05-19 15:55:03 -04:00
Steve Howell
338d2dc29a node tests: Localize overrides for compose test. 2021-05-19 15:55:03 -04:00
akshatdalton
9554514d3c refactor: Merge markdown_katex.js test file with markdown.js.
We split them in the commit: c50dbf8297
because at that time we thought markdown_katex was gonna
require rewireproxy magic in the later commits.
But we later removed the rewiremock dependency in the
commit: 30c7108955.

So now, we can safely merge `markdown_katex.js` test file
with `markdown.js` test file.
2021-05-19 11:59:28 -07:00
akshatdalton
769cd06ab6 refactor: Extract linkifier non-settings logic from markdown.js.
The extracted logic is in linkifier.js.
We have decided to name it linkifier.js instead of realm_linkifier.js
because in future when we will add stream-level linkifiers, we'll
likely want them to be managed by this same file.
2021-05-19 11:59:28 -07:00
Steve Howell
ef4446204d node tests: Add test wrapper for message_list_view. 2021-05-19 11:20:23 -04:00
Steve Howell
664afd2a1c node tests: Clean up electron_bridge test.
We use with_field to avoid leaks and then
just organize things better.
2021-05-19 11:06:18 -04:00
rht
aa3cdfa2e9 Fix typos using codespell.
The command:
codespell --skip='./locale,*.svg,./docs/translating,postgresql.conf.template.erb,.*fixtures,./yarn.lock,./docs/THIRDPARTY,./tools/setup/emoji/emoji_names.py,./tools/setup/emoji/emoji_map.json,./zerver/management/data/unified_reactions.json' --ignore-words=codespell_ignore_words.txt .

The content of codespell_ignore_words:
```
te
ans
pullrequest
ist
cros
wit
nwe
circularly
ned
ba
ressemble
ser
sur
hel
fpr
alls
nd
ot
```
2021-05-18 17:33:51 -07:00
Steve Howell
bdb2fa707c node tests: Use override for insert_or_move. 2021-05-18 18:34:17 -04:00
Steve Howell
1246970c23 node tests: Tweak test for first/prev/next. 2021-05-18 18:34:17 -04:00
Steve Howell
eb46ac408d node tests: Add activity.clear_for_testing(). 2021-05-18 18:34:17 -04:00
Steve Howell
fb0ba995c3 node tests: Use real version of keydown_util. 2021-05-18 18:34:17 -04:00
Steve Howell
5cbeaf1728 node test: Simplify presence statuses.
The test() wrapper makes a new map every time
with only "mark" as the idle user.
2021-05-18 18:34:17 -04:00
Steve Howell
2d02297f43 node tests: Use test() wrapper consistently.
The diff is slightly noisy due to some lexical
code moves, but otherwise it's search/replace.
2021-05-18 18:34:17 -04:00
Steve Howell
36077774fc node tests: Use override for fill_screen_with_content. 2021-05-18 18:34:17 -04:00
Steve Howell
7a9d0a505d node tests: Avoid rewiring client_is_active. 2021-05-18 18:34:17 -04:00
Steve Howell
7a3ba26c78 zjquery: Support $(...)[i] syntax. 2021-05-18 18:34:17 -04:00
Steve Howell
976374ed04 buddy_list: Localize overrides for buddy_list. 2021-05-18 18:34:17 -04:00
Steve Howell
b7a188fde8 node tests: Deepen filter_user_ids test.
We now test that activity.build_user_sidebar
integrates with the user_search code.
2021-05-18 18:34:17 -04:00
Steve Howell
45fb7165b1 node tests: Test list cursor more directly.
This tests the basic mechanics of list_cursor
more directly than the activity node tests.

It also sets the stage to eliminate some
tests from activity.js while maintaining
100% coverage on list_cursor.
2021-05-18 14:16:55 -04:00
Steve Howell
dbd60d18fe minor: Tweak list_cursor tests.
We just make the config a bit more explicit in
each test, and we use override to ensure that
stub functions aren't cruft.
2021-05-18 14:16:55 -04:00
Steve Howell
cd1510c0ef node tests: Extract user_search tests.
This is mostly moving tests from activity.js
into user_search.js, but it's not a verbatim
code move.

The new module continues to make sure that
the boundary between activity and user_search
is correct, as most of the testing uses
the configuration of UserSearch from
static/js/activity.js.

It does not use a real buddy_list, though,
which simplifies some tests.

I cleaned up some tests by making sure we
were testing both sides of conditions more
rigorously.

After this change we no longer need the
bloated activity.js tests to maintain full
coverage on static/js/user_search.js.
2021-05-18 14:16:55 -04:00
Steve Howell
ee066a1a91 node tests: Use per-test overrides for activity tests. 2021-05-18 14:16:55 -04:00
Steve Howell
eee8ff40b4 node tests: Fix false positive for muted user.
The test was passing here because we didn't add
selma. We want to make sure it's due to the actual
muting.
2021-05-16 11:48:50 -04:00
Steve Howell
9825be339b node tests: Test buddy_data.get_items_for_users. 2021-05-16 11:48:50 -04:00
Steve Howell
4a20c968d0 node tests: Test level/description for buddy_data. 2021-05-16 11:48:50 -04:00
Vishnu KS
27a2317e65 billing: Add node template test for plan change form. 2021-05-14 15:10:02 -07:00
Vishnu KS
323ad83d98 billing: Allow updating licenses of plans on manual license management. 2021-05-14 15:10:02 -07:00
Vishnu KS
51ef5d62ad billing: Add ignored_inputs paramater to create_ajax_request. 2021-05-14 15:10:02 -07:00
Vishnu KS
d9baa681b2 billing: Use PATCH request for changing plan status.
I think it's much more cleaner to use PATCH request on
/json/billing/plan than using a POST request on
/json/billing/plan/change to update the plan.
2021-05-14 15:10:02 -07:00
Steve Howell
78c2279c93 node tests: Clear muted users before each test. 2021-05-13 14:53:14 -04:00
sahil839
c7d4640af5 setting: Add dropdown for managing who can move messages between streams.
This commit adds the dropdown in 'Stream settings' section of organization
permissions page to control who can move messages between streams and
also hides the stream-edit UI in message-edit form accordingly.

Fixes #14499.
2021-05-13 08:42:24 -07:00
sahil839
6f4af26585 node_tests: Extract main logic of testing policies in a common function.
This commit extracts the logic for testing user_can_invite_others_to_realm
user_can_create_streams, and user_can_subscribe_other_users to a single
function test_policy and this function test_policy is called passing
different policies and validation functions as arguments.

This helps in removing a lot of duplicated code.
2021-05-13 08:42:24 -07:00
Abhijeet Prasad Bodas
a377a2df8b pm_list: Use "Muted user" placeholder for muted usernames.
This also handles a few other places missed earlier like
narrow headings, beacuse they use the same function.

We already rerender the PM list for events, so there's no
need to do anything special when someone is muted/unmuted.

`people.get_full_names` is now only used in the settings pages
while creating ListWidgets etc, so we add a new test for
it to ensure coverage.
2021-05-13 07:51:21 -07:00
Tim Abbott
3d6af7a3c8 typeahead: Fetch stream topic history from server.
Long ago, we changed Zulip to inspect server-provided topic history in
our compose and search typeahead modules, but did not trigger a query
to the server to fetch data.

This could result in confusing experiences where someone thought that
a topic doesn't exist that just isn't present in recent history.

Once we merge this, we may want to adjust the messaging in typeahead
to advertise that the first option will create a new topic, since this
change may make it feel more like creating topics is a heavyweight
operation.

Fixes #9857.
2021-05-12 15:21:25 -07:00
Tim Abbott
b67b9912c4 drafts: Fix hook for saving drafts.
Previously, the hook to save drafts when closing the compose box was a
focusout on #compose-textarea. This mostly worked, and was essentially
invisible to users (because the animation to notify you about saved
drafts was in the close_compose_ui widget that is hidden), but you'd
end up seeing the tooltip appear (in the wrong place) if you closed
the compose box immediately after sending a message with Tab+Enter.

The correct fix is for the drafts hook to be just before we start
clearing compose box state, inside hide_box.

This was difficult to catch in a development environment, since one
doesn't use that flow with "Enter sends" enabled.
2021-05-12 12:53:58 -07:00
Tim Abbott
b0f8bbfbd4 recent_topics: Fix annoying flicker on rerendering.
We were apparently not using the ListWidget API for replacing the
content of a widget without removing the whole thing from the DOM and
replacing it.

Unless ListWidget has unexpected bugs, this should have the exact same
result as the previous logic, with much a nicer user experience.
2021-05-12 10:02:48 -07:00
Abhijeet Prasad Bodas
e5a339df25 recent topics: Handle muted user avatars in participants.
We use styling same as that of the number shown for overflow
(e.g "+3") which has a gray background.
To keep these avatars up-to-date, we need to rerender the
recent topics view after receiving a `muted_users` event.

Also update the user documentation to mention this detail.
We deliberately avoid mentioning "recent topics" because
this applies to mobile too.
2021-05-12 09:30:24 -07:00
Abhijeet Prasad Bodas
e4cbfcaf1d recent senders: Rename sender_info getter function for brevity.
We will also later use this function for attaching other
information to it like whether the sender has been muted
or not.
2021-05-12 09:30:24 -07:00
Tim Abbott
9e812c5683 hashchange: Show default view behind overlays on load.
This seems more consistent with what users would expect; Recent topics
may be a better default view in general, but if a user has picked
another default view, we should use that where the default view is
desired.
2021-05-12 08:42:24 -07:00
Tim Abbott
8e7761e15b compose: Move closed-compose functions to closed_compose_ui.js.
This improves the organization of our codebase a bit.
2021-05-11 23:57:57 -07:00