refactor: Use early-return in extract_people_from_message().

This commit is contained in:
Steve Howell
2017-11-06 07:47:19 -08:00
committed by Tim Abbott
parent 294a1fb8f8
commit aebfdaa8ed
2 changed files with 29 additions and 13 deletions

View File

@@ -431,6 +431,12 @@ initialize();
initialize();
(function test_extract_people_from_message() {
var unknown_user = {
email: 'unknown@example.com',
user_id: 500,
unknown_local_echo_user: true,
};
var maria = {
email: 'athens@example.com',
user_id: 452,
@@ -446,6 +452,13 @@ initialize();
assert(!people.is_known_user_id(maria.user_id));
people.extract_people_from_message(message);
assert(people.is_known_user_id(maria.user_id));
// Get line coverage
message = {
type: 'private',
display_recipient: [unknown_user],
};
people.extract_people_from_message(message);
}());
initialize();