mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
47 lines
968 B
JavaScript
47 lines
968 B
JavaScript
import {
|
|
createAndPopulateGroup,
|
|
generateUser,
|
|
generateGroup,
|
|
requester,
|
|
} from '../../../../helpers/api-integration.helper';
|
|
|
|
describe('GET /groups/:groupId/chat', () => {
|
|
let user, api;
|
|
|
|
before(() => {
|
|
return generateUser({balance: 2}).then((generatedUser) => {
|
|
user = generatedUser;
|
|
api = requester(user);
|
|
});
|
|
});
|
|
|
|
context('public Guild', () => {
|
|
let group;
|
|
|
|
before(() => {
|
|
return generateGroup(user, {
|
|
name: 'test group',
|
|
type: 'guild',
|
|
privacy: 'public',
|
|
}, {
|
|
chat: [
|
|
'Hello',
|
|
'Welcome to the Guild',
|
|
],
|
|
})
|
|
.then((createdGroup) => {
|
|
group = createdGroup;
|
|
});
|
|
});
|
|
|
|
it('returns Guild chat', () => {
|
|
return api.get('/groups/' + group._id + '/chat')
|
|
.then((getChat) => {
|
|
expect(getChat).to.eql(group.chat);
|
|
});
|
|
});
|
|
|
|
// TODO tests that you can only access your groups' chat
|
|
});
|
|
});
|