FIX: Group membership button now showing properly.
This commit is contained in:
parent
761d524024
commit
3aed15c99e
|
@ -17,7 +17,7 @@ export default Ember.Component.extend({
|
|||
if (isGroupUser) {
|
||||
return isGroupUser;
|
||||
} else {
|
||||
return groupUserIds.includes(groupId);
|
||||
return !!groupUserIds && groupUserIds.includes(groupId);
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -35,3 +35,27 @@ test('canRequestMembership', function() {
|
|||
|
||||
equal(this.subject().get('canRequestMembership'), false);
|
||||
});
|
||||
|
||||
test('userIsGroupUser', function() {
|
||||
this.subject().setProperties({
|
||||
model: { is_group_user: true }
|
||||
});
|
||||
|
||||
equal(this.subject().get('userIsGroupUser'), true);
|
||||
|
||||
this.subject().set('model.is_group_user', false);
|
||||
|
||||
equal(this.subject().get('userIsGroupUser'), false);
|
||||
|
||||
this.subject().setProperties({ model: { id: 1 }, groupUserIds: [1] });
|
||||
|
||||
equal(this.subject().get('userIsGroupUser'), true);
|
||||
|
||||
this.subject().set('groupUserIds', [3]);
|
||||
|
||||
equal(this.subject().get('userIsGroupUser'), false);
|
||||
|
||||
this.subject().set('groupUserIds', undefined);
|
||||
|
||||
equal(this.subject().get('userIsGroupUser'), false);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue