Fix the build.

This commit is contained in:
Guo Xiang Tan 2018-03-19 18:47:17 +08:00
parent 41b0fbe001
commit 2b7fb43d84
2 changed files with 2 additions and 21 deletions

View File

@ -15,11 +15,7 @@ export default Ember.Component.extend({
@computed("model.is_group_user")
userIsGroupUser(isGroupUser) {
if (isGroupUser !== undefined) {
return isGroupUser;
} else {
return false;
}
return !!isGroupUser;
},
_showLoginModal() {

View File

@ -61,22 +61,7 @@ QUnit.test('userIsGroupUser', function(assert) {
assert.equal(this.subject().get('userIsGroupUser'), false);
this.subject().setProperties({ model: { id: 1 }, groupUserIds: [1] });
assert.equal(this.subject().get('userIsGroupUser'), true);
this.subject().set('groupUserIds', [3]);
assert.equal(this.subject().get('userIsGroupUser'), false);
this.subject().set('groupUserIds', undefined);
assert.equal(this.subject().get('userIsGroupUser'), false);
this.subject().setProperties({
groupUserIds: [1, 3],
model: { id: 1, is_group_user: false }
});
this.subject().set('model.is_group_user', null);
assert.equal(this.subject().get('userIsGroupUser'), false);
});