mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
test(api): chat WIP
This commit is contained in:
41
test/api/v3/integration/chat/GET-chat.test.js
Normal file
41
test/api/v3/integration/chat/GET-chat.test.js
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import {
|
||||||
|
createAndPopulateGroup,
|
||||||
|
generateUser,
|
||||||
|
requester,
|
||||||
|
} from '../../../../helpers/api-integration.helper';
|
||||||
|
|
||||||
|
describe.only('GET /groups/:groupId/chat', () => {
|
||||||
|
let user, api;
|
||||||
|
|
||||||
|
before(() => {
|
||||||
|
return generateUser().then((generatedUser) => {
|
||||||
|
user = generatedUser;
|
||||||
|
api = requester(user);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
context('public Guild', () => {
|
||||||
|
let group;
|
||||||
|
|
||||||
|
before(() => {
|
||||||
|
return createAndPopulateGroup({groupDetails: {
|
||||||
|
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);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
Reference in New Issue
Block a user