zulip/frontend_tests
Steve Howell 58b72a2194 refactor: Make bot owner hovers more robust.
This is code simplification motivated
by a recent bug that we fixed with some
server changes, but which was really
caused in some sense by our client code
using an overly finicky
condition to check falsiness.

For cross-realm bots, the value of
`user.bot_owner_id` may be `null`, or it
may simply be `undefined`, depending
on whether the server passes `None`
or simply omits the field.

We don't want out client code to be
coupled to that rather arbitrary
decision.

We were doing a `!== null` check instead
of checking for falsiness, which led to
blueslip errors in the past.  Because a
bot owner id could be plausibly 0, a falsiness
check would be brittle in a different way.

Now we avoid that ugliness by calling
`get_bot_owner_user`, which either returns
an object or `undefined`.

And then the caller can just do a concise
check for whether `bot_owner` exists.

And we also fix up the crufty code that
was putting `bot_owner_full_name` on to
the object instead of using a local.

We have a bug report for this again, although
it might be on an old branch.

Fixes #13621.
2020-03-24 20:40:19 -07:00
..
casper_lib casper: Use data-stream-id to find checkboxes. 2020-01-28 14:49:57 -08:00
casper_tests casper: Fix buggy waiting logic in 08-edit. 2020-03-22 11:17:26 -07:00
node_tests refactor: Make bot owner hovers more robust. 2020-03-24 20:40:19 -07:00
zjsunit node tests: Just set i18n every time. 2020-02-28 17:11:24 -08:00
.eslintrc.json lint: Check eslint indentation for casper tests. 2018-05-06 19:35:18 -07:00
run-casper populate_db, tests: Restrict emails in zulip realm. 2020-03-19 16:21:31 -07:00