ES6ify /gr-account-link/*
Bug: Issue 6179 Change-Id: I4689b445adccac2797f8768fda02ec71ac33f2b1
This commit is contained in:
@@ -29,13 +29,13 @@
|
||||
Gerrit.BaseUrlBehavior,
|
||||
],
|
||||
|
||||
_computeOwnerLink: function(account) {
|
||||
_computeOwnerLink(account) {
|
||||
if (!account) { return; }
|
||||
var accountID = account.email || account._account_id;
|
||||
const accountID = account.email || account._account_id;
|
||||
return this.getBaseUrl() + '/q/owner:' + encodeURIComponent(accountID);
|
||||
},
|
||||
|
||||
_computeShowEmail: function(account) {
|
||||
_computeShowEmail(account) {
|
||||
return !!(account && !account.name);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -32,21 +32,21 @@ limitations under the License.
|
||||
</test-fixture>
|
||||
|
||||
<script>
|
||||
suite('gr-account-link tests', function() {
|
||||
var element;
|
||||
suite('gr-account-link tests', () => {
|
||||
let element;
|
||||
|
||||
setup(function() {
|
||||
setup(() => {
|
||||
stub('gr-rest-api-interface', {
|
||||
getConfig: function() { return Promise.resolve({}); },
|
||||
getConfig() { return Promise.resolve({}); },
|
||||
});
|
||||
element = fixture('basic');
|
||||
});
|
||||
|
||||
test('computed fields', function() {
|
||||
test('computed fields', () => {
|
||||
assert.equal(element._computeOwnerLink(
|
||||
{
|
||||
_account_id: 123,
|
||||
email: 'andybons+gerrit@gmail.com'
|
||||
email: 'andybons+gerrit@gmail.com',
|
||||
}),
|
||||
'/q/owner:andybons%2Bgerrit%40gmail.com');
|
||||
|
||||
@@ -57,6 +57,5 @@ limitations under the License.
|
||||
|
||||
assert.equal(element._computeShowEmail({}), true);
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user