Commit Graph

19 Commits

Author SHA1 Message Date
Steve Howell c407ba5175 Add narrow_state.is_reading_mode(). 2018-07-10 14:20:24 +05:30
Shubham Padia 0ffcb7fccf search: Remove blueslip warnings for invalid emails in 'pm-with' filter.
Fixes #3380.
The blueslip warning mentioned in #3380 were from paths ending at
people.email_list_to_user_ids_string. Some additional blueslip warnings
were raised after using that function.
Although we can put a validation check somewhere in the call stack of
people.email_list_to_user_ids_string, this function itself is used to
validate the operand by the higher order functions, so it wouldn't make
sense to put a validation check before that. Instead, removing the
blueslip warning altogether was chosen.
people.email_list_to_user_ids_string was replaced by
people.reply_to_to_user_ids_string which is a blueslip-free version
of the same. Other blueslip warnings were removed.
2018-05-30 07:49:59 -04:00
Shubham Padia 6ea6f5e0af search: Do not open compose box if invalid recipient present in `pm-with`.
If atleast one of the private_message_recipients is invalid, compose
box will not be opened.
Thanks to Aastha Gupta <aastha.gupta4104@gmail.com> for some preliminary
work on this.
2018-05-28 10:45:42 -07:00
Steve Howell 42435db492 Add run_test helper for individual tests.
This run_test helper sets up a convention that allows
us to give really short tracebacks for errors, and
eventually we can have more control over running
individual tests.  (The latter goal has some
complications, since we often intentionally leak
setup in tests.)
2018-05-15 08:24:44 -07:00
Steve Howell 7222dbd99b refactor: Simplify narrow_state.is_for_stream_id().
This takes advantage of the new function narrow_state.stream_id().

We now assume the incoming stream_id is a valid stream_id, so we
no longer need to test some of the error checking.  (It's possible that
the incoming stream_id may no longer be for a stream you subscribe
to, but the nice benefit of working more in "id space" is that if
it doesn't match the narrow's stream id, we know false is a safe
return value.)
2018-05-02 09:16:24 -07:00
Steve Howell a62c85c015 Add narrow_state.stream_sub() and narrow_state.stream_id(). 2018-05-02 09:16:24 -07:00
Rohitt Vashishtha 639fa0db77 zblueslip: Convert node_tests/narrow_state.js to zblueslip. 2018-04-30 10:12:55 -07:00
Steve Howell 13abed229c Add narrow_state.pm_string(). 2018-02-12 09:34:59 -08:00
cPhost 3dc315a0a1 node tests: Add 100% coverage for narrow_state.js. 2017-12-18 09:57:43 -05:00
Jerry Zhang e134fd610e node tests: Cover exports.is_for_stream_id. 2017-12-07 14:58:27 -08:00
cPhost 5f50786129 node tests: Cover exports.operators. 2017-12-03 14:01:19 -08:00
cPhost 8b7e355949 node tests: Cover single_collect. 2017-12-03 14:01:19 -08:00
cPhost 8d0ccd29fe narrow_state: Make set_compose_defaults return opts. 2017-12-03 14:01:19 -08:00
cPhost 6e5dab6a1e node tests: Cover set_compose_defaults. 2017-11-30 06:25:36 -08:00
Sivagiri 4871b48bf2 node tests: Add tests for stream() and topic() in narrow_state. 2017-11-29 09:39:43 -08:00
Steve Howell 65dc6a0975 node tests: Use zrequire in narrow_state.js. 2017-11-08 12:24:17 -08:00
Joshua Pan c4914eeec9 narrow.js: Create narrowed_by_stream_reply().
This function returns if you are narrowed
to a stream.
2017-06-27 14:06:59 -04:00
Steve Howell 1a4c8a598d tests: Add more coverage to narrow_state.js in test_stream(). 2017-06-01 22:14:11 -07:00
Steve Howell 8a39e67876 node tests: Extract narrow_state tests to new module. 2017-06-01 22:14:11 -07:00