mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-19 15:48:04 +01:00
tests(api): Add sync method to api objects
This commit is contained in:
@@ -2,7 +2,6 @@ import {
|
||||
checkExistence,
|
||||
createAndPopulateGroup,
|
||||
} from '../../../helpers/api-integration/v2';
|
||||
import { find } from 'lodash';
|
||||
|
||||
describe('POST /groups/:id/leave', () => {
|
||||
context('user is not member of the group', () => {
|
||||
@@ -29,10 +28,9 @@ describe('POST /groups/:id/leave', () => {
|
||||
it('leaves the group', async () => {
|
||||
await user.post(`/groups/${group._id}/leave`);
|
||||
|
||||
let members = (await user.get(`/groups/${group._id}`)).members;
|
||||
let userInGroup = find(members, '_id', user._id);
|
||||
await group.sync();
|
||||
|
||||
expect(userInGroup).to.not.be.ok;
|
||||
expect(group.members).to.not.include(user._id);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user