dispatch test: Restore 100% line coverage (user_status).

We now have 100% coverage on server_events_dispatch.js.

The last piece were was covering "status_text" updates
in the "user_status" event.
This commit is contained in:
Steve Howell
2019-01-26 18:29:06 +00:00
committed by showell
parent 1279249a09
commit 1228e541d7
2 changed files with 12 additions and 0 deletions

View File

@@ -89,6 +89,7 @@ zrequire('message_store');
zrequire('people');
zrequire('starred_messages');
zrequire('util');
zrequire('user_status');
zrequire('server_events_dispatch');
function dispatch(ev) {
@@ -1460,4 +1461,14 @@ with_overrides(function (override) {
var args = stub.get_args('user_id');
assert_same(args.user_id, 63);
});
event = event_fixtures.user_status__set_status_text;
global.with_stub(function (stub) {
override('activity.redraw_user', stub.f);
dispatch(event);
var args = stub.get_args('user_id');
assert_same(args.user_id, test_user.user_id);
var status_text = user_status.get_status_text(test_user.user_id);
assert.equal(status_text, 'out to lunch');
});
});

View File

@@ -65,6 +65,7 @@ enforce_fully_covered = {
'static/js/search.js',
'static/js/search_suggestion.js',
'static/js/search_util.js',
'static/js/server_events_dispatch.js',
# Removed because we're migrating code from uncovered other settings pages to here.
# 'static/js/settings_ui.js',
'static/js/settings_muting.js',