fix: Lint errors for account username return type
This commit is contained in:
2 files changed
+8
-4
No files matched your search
@@ -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
|
||||
|
||||
@@ -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');
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user