Merge "Remove parentheses around email in account-label"

This commit is contained in:
Wyatt Allen
2016-11-23 20:05:23 +00:00
committed by Gerrit Code Review
3 changed files with 11 additions and 1 deletions

View File

@@ -42,7 +42,7 @@ limitations under the License.
<span class="text">
<span>[[account.name]]</span>
<span hidden$="[[!_computeShowEmail(showEmail, account)]]">
([[account.email]])
[[_computeEmailStr(account)]]
</span>
</span>
</span>

View File

@@ -44,5 +44,12 @@
_computeShowEmail: function(showEmail, account) {
return !!(showEmail && account && account.email);
},
_computeEmailStr: function(account) {
if (account.name) {
return '(' + account.email + ')';
}
return account.email;
},
});
})();

View File

@@ -71,6 +71,9 @@ limitations under the License.
assert.equal(element._computeShowEmail(
false, undefined), false);
assert.equal(element._computeEmailStr({name: 'test', email: 'test'}), '(test)');
assert.equal(element._computeEmailStr({email: 'test'}, ''), 'test');
});
});