fix: Lint errors for account username return type

This commit is contained in:
Susmitha Girumala committed 2020-09-18 14:33:10 -04:00
1 parent 3ae2db9562
commit 1c16f8fe19
2 files changed
+8 -4

No files matched your search

+7 -3
View File
@@ -16,11 +16,15 @@ export default class AccountModel extends GeneratedAccountModel {
* Convenience for getting username in account.
* @type {string}
*/
@computed('attributes')
@computed('attributes.{login_name}')
get username() {
if(this.type === 'password') {
return this.attributes.login_name;
let username = '';
switch (this.type) {
case 'password':
username = this.attributes.login_name;
break;
}
return username;
}
// =methods
+1 -1
View File
@@ -17,7 +17,7 @@ module('Unit | Model | account', function (hooks) {
name: 'name',
type: 'password',
});
assert.equal(model.username, null);
assert.notOk(model.username);
model.attributes.login_name = 'username';
assert.equal(model.username, 'username');
});