fix: Default group.member_ids to an empty array

This commit is contained in:
Susmitha Girumala committed 2020-09-08 16:23:04 -04:00
1 parent 90ff86a3f8
commit 8a5130932b
3 files changed
+17 -2

No files matched your search

@@ -130,4 +130,17 @@ module('Unit | Model | group', function(hooks) {
const model = store.peekRecord('group', '123abc');
await model.removeMember('3');
});
test('it defaults `members_ids` to an empty array when model instance does not define it', function(assert) {
assert.expect(1);
const store = this.owner.lookup('service:store');
store.push({
data: {
id: 'group_123',
type: 'group'
}
});
const group = store.peekRecord('group', 'group_123');
assert.equal(group.member_ids.length, 0, 'Group has empty member_ids by default');
});
});