habitica/test/api/v3/integration/groups/GET-group-plans.test.js

27 lines
634 B
JavaScript
Raw Permalink Normal View History

import {
2023-08-02 22:00:41 +00:00
createAndPopulateGroup,
2018-06-18 12:40:25 +00:00
} from '../../../../helpers/api-integration/v3';
describe('GET /group-plans', () => {
let user;
let groupPlan;
before(async () => {
2023-08-02 22:00:41 +00:00
({ group: groupPlan, groupLeader: user } = await createAndPopulateGroup({
groupDetails: {
name: 'group plan - is member',
type: 'guild',
2023-08-02 22:00:41 +00:00
privacy: 'private',
},
2023-08-02 22:00:41 +00:00
upgradeToGroupPlan: true,
leaderDetails: { balance: 4 },
}));
});
it('returns group plans for the user', async () => {
2019-10-08 18:45:38 +00:00
const groupPlans = await user.get('/group-plans');
expect(groupPlans[0]._id).to.eql(groupPlan._id);
});
});