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